Results 1 to 3 of 3

Thread: [RESOLVED] Control.CheckForIllegalCrossThreadCalls property

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    364

    Resolved [RESOLVED] Control.CheckForIllegalCrossThreadCalls property

    Hello Everyone,
    would someone be able to tell me how to use this property properly and exactly what it will do please?

    http://msdn2.microsoft.com/en-us/lib...readcalls.aspx

    thank you very much
    Richard <><

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Control.CheckForIllegalCrossThreadCalls property

    In .NET 1.x you could access members of a control directly from a thread other than the UI thread even though it is not a thread-safe operation. In .NET 2.0, the default is for Control.CheckForIllegalCrossThreadCalls to be True and any direct access of a control member from a thread other than the UI thread to cause an exception to be thrown. By default you must use a delegate to access a control member across thread boundaries. If you want to be lazy and risk unexpected run time errors, or you are ABSOLUTELY sure there will be no issues, you can set this property to False and access control members freely across thread boundaries. You can still use a delegate if you want to, just as you could in .NET 1.x, but it is not enforced. If you don't know what delegates are and how they are used to accomplish cross-thread method calls, search for "delegate" with my user name for a couple of simple examples, from myself and others.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    364

    Re: [RESOLVED] Control.CheckForIllegalCrossThreadCalls property

    thanks, I will use delegates
    Richard <><

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width