This situation is caused by multiple threads, the project encountered such a situation, checked online solutions ... Khan, will not work. Only on your own!
First, () a function with the static void Main before [the STAThreadAttribute]
Then that function in the new thread
Thread t = new Thread (new ThreadStart (FlyMessage)); // Create a thread
t.ApartmentState = ApartmentState.STA; // add this sentence!
t.Start (); // start the thread
now ok the ~ ~ try again, goodluck ~~
Original Address http://www.cnblogs.com/zjoch/archive/2010/04/14/1711801.html
Reproduced in: https: //www.cnblogs.com/daretodream/archive/2010/04/29/1723676.html