stag92's Profile
Reputation: 0
Apprentice
- Group:
- New Members
- Active Posts:
- 1 (0 per day)
- Joined:
- 15-May 12
- Profile Views:
- 325
- Last Active:
May 15 2012 09:59 AM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Cross Thread Communication in C#
Posted 15 May 2012
frankg, on 23 August 2010 - 07:09 AM, said:I couldn't believe it. After going through all kinds of gyrations for more than a day, I finally found the right article. This simple code did the trick for me:
public delegate void serviceGUIDelegate();
private void sendToGUI()
{
this.Invoke(new serviceGUIDelegate(serviceGUI));
}
"serviceGUI()" is a GUI level method within the form (this) that can change as many controls as you want. Just call sendToGUI() from the other thread. Parameters can be added to pass values, or just use class scope variables.
This is perfect, that's what i've been looking for last few days. Everybody writes about delegates, an.pipes or named pipes. Here is a simple answer for my big problem. Thanks for telling me how invoke sth i the parent's context. Great!
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Click here to e-mail me
Friends
stag92 hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
stag92 has no profile comments yet. Why not say hello?