Accesing frmMain events from a thread
I have a main form called frmMain. Within that form there is a flash control that loads some flash files. When the application starts, I create a thread on which I am scanning for some Radio Frequency tags. Once I see that a tag is in range I need to take some action. Until this point everything runs fine. I somehow need the ability to execute a event OnFSCommand in the frmMain so that I can push the user to a specific screen when a RFID tag is recognized. For that I have to create another frmMain Object because the RFID scanning is happening in a different class. How can I make this happen ?
AdwaitPosted Aug 15, 2007, 3:16 PM
AlanPosted Aug 15, 2007, 2:55 PM
What might work is to get a reference to the main form like this:
frmMain frm = (frmMain)Application.OpenForms[0];
You could then call frm's Invoke or BeginInvoke methods with a suitable delegate to fire the event on the UI thread.