winforms - Two UI Thread in C# windows Application -
how can implement 2 ui threads in c# windows application?
you need call thread.setapartmentstate() switch thread sta before starting it. , pump message loop keep windows created on thread alive, application.run(). application.exitthread() terminate message loop , cause thread exit. using run(form) makes automatic, on main thread.
beware user may have hard time dealing windows create on thread. have no z-order relationship windows in main thread, desktop parent. tends make them lost behind window, including own. awkward workarounds topmost , pinvoking setparent().
Comments
Post a Comment