. NET cannot invoke invoke or BeginInvoke on the control until the window handle is created.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.