Possible to construct form on background thread, then display on UI thread

后端 未结 6 1524
情话喂你
情话喂你 2020-12-10 04:10

UPDATE: Just to summarize what my question has boiled down to:

I was hoping that constructing .NET forms and controls did NOT create any window handles -- hoping tha

6条回答
  •  春和景丽
    2020-12-10 04:40

    The answer is no.

    If you create a window handle on any thread other than the GUI thread you can never show it.

    Edit: It is completely possible to create Forms and controls and display them in a thread other than the main GUI thread. Of course if you do this you can only access the multi threaded GUI from the thread that created it, but it is possible. – Ashley Henderson

    You need to perform any heavy lifting on a bg thread and then load the data into you GUI widget

提交回复
热议问题