Click here to Skip to main content
16,013,440 members
Home / Discussions / C#
   

C#

 
QuestionIHTMLDOMNode doesn't have onClick event :( Pin
lulaleila7-Dec-06 4:35
lulaleila7-Dec-06 4:35 
Questionpass dropdown with 2 values Pin
Tanuja1237-Dec-06 4:34
Tanuja1237-Dec-06 4:34 
AnswerRe: pass dropdown with 2 values Pin
albCode7-Dec-06 5:17
albCode7-Dec-06 5:17 
QuestionForce my WinForm application to show… Pin
anderslundsgard7-Dec-06 4:07
anderslundsgard7-Dec-06 4:07 
AnswerRe: Force my WinForm application to show… Pin
Eduard Keilholz7-Dec-06 4:18
Eduard Keilholz7-Dec-06 4:18 
AnswerRe: Force my WinForm application to show… Pin
Martin#7-Dec-06 4:32
Martin#7-Dec-06 4:32 
QuestionAutomation, cross thread problem Pin
anderslundsgard7-Dec-06 3:59
anderslundsgard7-Dec-06 3:59 
AnswerRe: Automation, cross thread problem Pin
Robert Rohde7-Dec-06 4:27
Robert Rohde7-Dec-06 4:27 
Hi,

using Invoke as you wrote in the other forum is the correct way to handle this. How to avoid changing all your calls depends on your situation. If you receive an event from another thread and want to call multiple methods on the TreeView then just marhsal the complete handler to the correct thread. Here a sample with a simple EventHandler:
public void HandleEvent(object sender, EventArgs ea) {
   if (myTreeView.InvokeRequired) 
   { 
       myTreeView.Invoke(new EventHandler(HandleEvent), sender, ea);
   }

   //do something on myTreeView
}

This method just calls itself within the correct thread if required.
If the code resides within the container control of the TreeView than you can also use base.InvokeRequired and base.Invoke.

Robert
GeneralRe: Automation, cross thread problem Pin
anderslundsgard7-Dec-06 20:28
anderslundsgard7-Dec-06 20:28 
QuestionCustom Control Development & Default Properties Pin
Ian Roberts7-Dec-06 3:46
Ian Roberts7-Dec-06 3:46 
AnswerRe: Custom Control Development & Default Properties Pin
Pete O'Hanlon7-Dec-06 4:36
mvePete O'Hanlon7-Dec-06 4:36 
QuestionReport Viewer LocalReport GetParameters Function Evaluation Failure Pin
Christopher Stratmann7-Dec-06 2:39
Christopher Stratmann7-Dec-06 2:39 
NewsRe: Report Viewer LocalReport GetParameters Function Evaluation Failure Pin
Christopher Stratmann7-Dec-06 3:34
Christopher Stratmann7-Dec-06 3:34 
GeneralRe: Report Viewer LocalReport GetParameters Function Evaluation Failure Pin
Christopher Stratmann7-Dec-06 5:42
Christopher Stratmann7-Dec-06 5:42 
QuestionClosing the form Pin
Niiiissssshhhhhuuuuu7-Dec-06 1:52
Niiiissssshhhhhuuuuu7-Dec-06 1:52 
AnswerRe: Closing the form Pin
quiteSmart7-Dec-06 1:55
quiteSmart7-Dec-06 1:55 
GeneralRe: Closing the form Pin
Niiiissssshhhhhuuuuu7-Dec-06 2:03
Niiiissssshhhhhuuuuu7-Dec-06 2:03 
GeneralRe: Closing the form Pin
quiteSmart7-Dec-06 2:12
quiteSmart7-Dec-06 2:12 
AnswerRe: Closing the form Pin
Robert Rohde7-Dec-06 2:24
Robert Rohde7-Dec-06 2:24 
GeneralRe: Closing the form Pin
quiteSmart7-Dec-06 2:54
quiteSmart7-Dec-06 2:54 
AnswerRe: Closing the form Pin
Stefan Troschuetz7-Dec-06 3:49
Stefan Troschuetz7-Dec-06 3:49 
GeneralRe: Closing the form Pin
Niiiissssshhhhhuuuuu7-Dec-06 16:20
Niiiissssshhhhhuuuuu7-Dec-06 16:20 
QuestionInherit TabControl? Pin
george ivanov7-Dec-06 0:33
george ivanov7-Dec-06 0:33 
AnswerRe: Inherit TabControl? Pin
Martin#7-Dec-06 0:39
Martin#7-Dec-06 0:39 
QuestionRaise control events Pin
Tanuja1237-Dec-06 0:10
Tanuja1237-Dec-06 0:10 

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.