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 ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

AlanRank #669 · 3.6K reputationPosted Aug 15, 2007, 10:55 AM EDT
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.
Adwait8 reputationPosted Aug 15, 2007, 11:16 AM EDT