Click here to Skip to main content
15,904,822 members
Home / Discussions / C#
   

C#

 
GeneralRe: Line Segments Pin
Jim Warburton26-Nov-07 8:59
Jim Warburton26-Nov-07 8:59 
QuestionHow to know which tree view node on master page is clicked on the form level Pin
ss.mmm26-Nov-07 5:09
ss.mmm26-Nov-07 5:09 
AnswerRe: How to know which tree view node on master page is clicked on the form level Pin
SABhatti26-Nov-07 8:53
SABhatti26-Nov-07 8:53 
QuestionUpdating controls from non-gui thread. Pin
Rob Philpott26-Nov-07 5:09
Rob Philpott26-Nov-07 5:09 
AnswerRe: Updating controls from non-gui thread. Pin
m@u26-Nov-07 5:21
m@u26-Nov-07 5:21 
GeneralRe: Updating controls from non-gui thread. Pin
Rob Philpott26-Nov-07 5:25
Rob Philpott26-Nov-07 5:25 
GeneralRe: Updating controls from non-gui thread. Pin
m@u26-Nov-07 5:38
m@u26-Nov-07 5:38 
AnswerRe: Updating controls from non-gui thread. Pin
Luc Pattyn26-Nov-07 6:23
sitebuilderLuc Pattyn26-Nov-07 6:23 
Hi,

a thread that did not create a Control, should not access that Control, except for the
very few members explicitly allowed, including InvokeRequired and Invoke (but not Tag).

Before .NET 2.0 the app may behave badly, the GUI may freeze, anything can go wrong if
you violate the rule.

Since 2.0 you get an InvalidOperationException by default; you can disable that by setting
Control.CheckForIllegalCrossThreadCalls false, but that is a very bad idea, and it brings
you back in the previous situation.

Since most if not all Controls are somehow related (they are on a Form, one Form owns
another Form, etc), the natural consequence is all Controls get created and accessed
exclusively by a single thread, typically your initial or main thread, often also called
the "GUI thread".

There are lots of examples on InvokeRequired/Invoke available everywhere;
a rather advanced article on the subject is here[^].

Smile | :)



Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets


QuestionInserting into excel from C# Pin
GreekTreat26-Nov-07 5:06
GreekTreat26-Nov-07 5:06 
AnswerRe: Inserting into excel from C# Pin
GuyThiebaut26-Nov-07 5:16
professionalGuyThiebaut26-Nov-07 5:16 
GeneralRe: Inserting into excel from C# Pin
GreekTreat26-Nov-07 5:23
GreekTreat26-Nov-07 5:23 
AnswerRe: Inserting into excel from C# Pin
Aftab Sindhi26-Nov-07 5:23
Aftab Sindhi26-Nov-07 5:23 
QuestionArray Property Pin
papy-boom26-Nov-07 4:26
papy-boom26-Nov-07 4:26 
AnswerRe: Array Property Pin
Rob Philpott26-Nov-07 4:50
Rob Philpott26-Nov-07 4:50 
AnswerRe: Array Property Pin
Ravi Bhavnani26-Nov-07 5:15
professionalRavi Bhavnani26-Nov-07 5:15 
Questionhow to read particular data from xml file Pin
sivaramireddy p26-Nov-07 4:13
sivaramireddy p26-Nov-07 4:13 
AnswerRe: how to read particular data from xml file Pin
SABhatti26-Nov-07 4:23
SABhatti26-Nov-07 4:23 
AnswerRe: how to read particular data from xml file Pin
Ravi Bhavnani26-Nov-07 5:20
professionalRavi Bhavnani26-Nov-07 5:20 
AnswerRe: how to read particular data from xml file Pin
m026-Nov-07 13:09
m026-Nov-07 13:09 
QuestionHow to...? Pin
Tsebatsegeb26-Nov-07 3:28
Tsebatsegeb26-Nov-07 3:28 
AnswerRe: How to...? Pin
Colin Angus Mackay26-Nov-07 3:53
Colin Angus Mackay26-Nov-07 3:53 
GeneralRe: How to...? Pin
Rob Philpott26-Nov-07 4:53
Rob Philpott26-Nov-07 4:53 
QuestionNeed help for Lucene.Net.dll 2.0 Pin
monSur hoq26-Nov-07 3:24
monSur hoq26-Nov-07 3:24 
QuestionLinking different applications Pin
Ofori Boadu26-Nov-07 3:22
Ofori Boadu26-Nov-07 3:22 
AnswerRe: Linking different applications Pin
Colin Angus Mackay26-Nov-07 3:56
Colin Angus Mackay26-Nov-07 3:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.