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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -