G
Guest
I have two windows forms that the user toggles between; internally I show and
hide the forms. Each form is refreshed from the same thread and I use data
binding and an anonymous delegate event call to do the update.
Every once and awhile I will get the Object Disposed Exception with my form
object stated to be the culprit but when I step into the code I can step
through the delegate continue without problem so it seems the form is not
really disposed.
within class def (main thread)
public event EventHandler CPUUsagePercentChanged;
public string CPUUsagePercent { get { return
m_dCPUUsagePercent.ToString(); } }
tbCPU_Usage.DataBindings.Add("Text", this, "CPUUsagePercent");
within update thread
Invoke((MethodInvoker)delegate()
{
CPUUsagePercentChanged(sm_this, EventArgs.Empty);
});
hide the forms. Each form is refreshed from the same thread and I use data
binding and an anonymous delegate event call to do the update.
Every once and awhile I will get the Object Disposed Exception with my form
object stated to be the culprit but when I step into the code I can step
through the delegate continue without problem so it seems the form is not
really disposed.
within class def (main thread)
public event EventHandler CPUUsagePercentChanged;
public string CPUUsagePercent { get { return
m_dCPUUsagePercent.ToString(); } }
tbCPU_Usage.DataBindings.Add("Text", this, "CPUUsagePercent");
within update thread
Invoke((MethodInvoker)delegate()
{
CPUUsagePercentChanged(sm_this, EventArgs.Empty);
});