Display Winform in a new thread

xiaoxiao2021-03-06  19

Recent studies have studied Dotmsn, where you need to display chat windows in a new thread when you join a session.

Start using

MyForm FM = new myform ();

Thread OtHread = New Thread (New ThreadStart (fm.show);

Othread.start ();

However, you can't get the correct result, always fm shows it, it will disappear immediately. I don't know why. Which hero knows, advice, not grateful.

After that, use the following method to get

Private void showform ()

{

MyForm FM = new myform ();

Application.run (fm);

}

Thread OtHread = New Thread (New ThreadStart (Showform);

Othread.start ();

It can get the normal result, Heph.

转载请注明原文地址:https://www.9cbs.com/read-43334.html

New Post(0)