Accessing GUI from event handler
<p>When a byte from the serial port is received, it enters this handler correctly, but my label on the GUI does not change. <strong>Edit</strong>: Yes, it is in the same class as the GUI
<strong>Edit 2</strong> The function declaration does not need to be 'static'...I merely copy-pasted <a href="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.datareceived.aspx" rel="nofollow">an example</a> from msdn
<strong>edit 3</strong> It works after getting rid of the static decleration and using something like <a href="http://c-sharp-programming.blogspot.com/2008/07/cross-thread-operation-not-valid.html" rel="nofollow">this</a>. 
Thanks for your help</p>

<pre><code>private static void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
        {
            Form1 gui = new Form1(); //main GUI

            try
            {
                SerialPort sp = (SerialPort)sender;
                string indata = sp.ReadExisting();
                //gui.rxLabel.Text = indata;
                gui.txLabel.Text = "testttingg";
            }
            .......
</code></pre>
