Modeless Form not repainting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a .net/C# com object that creates a thread and a window to output results obtained in the thread (the thread is reading a com port). Everything seems to be working correctly (I don't get any errors), but no results are displayed in the window. If I move the window it is not repainting itself, so I am sure that that is the problem, but I don't know how to fix it. Can someone give me a point in the right direction?

Thanks,

Phil
 
When you create the form, pass in a reference to a form that is definatley
on the GUI thread, I usually use the first form in the application. Then use
control invoke to call the update method something like the following:

//do your data stuff here
appParentForm.Invoke(new EventHandler(updateThisForm));


public void updateThisForm( Object sender, EventArgs e)
{
this.Invalidate();
}

Phil said:
I have a .net/C# com object that creates a thread and a window to output
results obtained in the thread (the thread is reading a com port).
Everything seems to be working correctly (I don't get any errors), but no
results are displayed in the window. If I move the window it is not
repainting itself, so I am sure that that is the problem, but I don't know
how to fix it. Can someone give me a point in the right direction?
 
Back
Top