creating a form handle
When the window is created, the window does not create a handle, only Application.Run (form) or form. Show () is followed by a handle, that is, the window only displays or starts the message loop before the handle! If the form is created, the form is called in the main thread. Handler, if the handle has not yet been created, referencing the property will force the creation of the handle, which will have a deadly effect on the logic of Xi's ability.
ishandlercreated PropertyDetermines whether a handle is created successfully by ishandlercreated, and then considers whether to use a delegate method to operate across threads. General usage is as follows:if (this. ishandlercreated){This . Invoke ((methodinvoker) Delegate {dosomething (); });}Else{dosomething ();}External links---Lan ([email protected])
. NET cannot invoke invoke or BeginInvoke on the control until the window handle is created.