I have a problem with Background worker in C# 05-24-2012, 10:31 PM
#1
Any problem with that code below? I have a problem while I try to show form or any thing related to form such as textbox, listbox, button.... Any command? Thank before hands.
Code:
private void Timer_Tick(object sender, EventArgs e)
{
if (backgroundWorker1.IsBusy == false)
{
backgroundWorker1.RunWorkerAsync(this);
}
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
try{
this.Show();
this.notifyIcon1.Visible = false;
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal;
}catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}