|
-
Jan 24th, 2006, 05:05 AM
#1
Thread Starter
Hyperactive Member
[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
-
Jan 24th, 2006, 06:39 AM
#2
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.
-
Jan 24th, 2006, 06:55 AM
#3
Thread Starter
Hyperactive Member
Re: [RESOLVED] Control.CheckForIllegalCrossThreadCalls property
thanks, I will use delegates
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|