How to start a UI thread in C#

前端 未结 4 1787
离开以前
离开以前 2021-01-02 12:09

I know I can start a new worker thread from with .NET. But how do I start a new UI thread (like in MFC)?

I don\'t mind if the solution is restricted to Windows boxes

4条回答
  •  [愿得一人]
    2021-01-02 12:37

    Use Application.Run - it starts a message loop in the current thread. There are overloads to take a form to start with, or an application context, or neither. (If you want to do this for a new thread, you need to create the thread and start it in the normal way, and make it call Application.Run.)

提交回复
热议问题