Hello!
I'm using the SerialPort Class in a college project, and I have a question:
- I'm using DataRecieved Delegate, which set a method to do all the work with incoming data. But this method needs to add text in a textbox on the main thread. How could I do that?
I'm sorry about my english!
Daniel FreirePosted Oct 8, 2008, 10:27 PM
AlanPosted Oct 7, 2008, 5:34 AM
Try something like this (.NET 2.0 or later):
this.Invoke(new MethodInvoker(delegate()
{
this.textBox1.Text += "whatever";
}));
If that doesn't work, then try BeginInvoke rather than Invoke.