What's wrong with my cross-thread call in Windows Forms?

后端 未结 7 1980
南笙
南笙 2021-01-04 22:32

I encounter a problem with a Windows Forms application.

A form must be displayed from another thread. So in the form class, I have the following code:



        
7条回答
  •  我在风中等你
    2021-01-04 23:09

    Most likely the handle of the control is not created yet, in which case Control.InvokeRequired returns false.

    Check the Control.IsHandleCreated property to see if this is the case.

提交回复
热议问题