|
-
Apr 26th, 2006, 09:02 PM
#1
Thread Starter
Not NoteMe
[2.0] Threads sharing a variable
I've got 2 threads, one deals with the UI the other adds stuff to a Queue variable. I want to get the UI thread to do stuff whenever the other thread adds to the queue.
I've searched and searched, but i'm not sure what i can do. I think in .NET 1.0/1.1 there was a CallBack variable which could be used to call a method in another thread, but it seems to have gone in 2.0
I've looked into raising an even in the UI thread, but i'm just not sure quite how to do it.
Any help or simple example would be greatly appreciated!
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 26th, 2006, 09:59 PM
#2
Re: [2.0] Threads sharing a variable
You would define a method that raises your event and then you would invoke it from the other thread using a delegate. A forum search should turn up examples of doing so. if not, check out the help topic for the Control.Invoke method.
-
Apr 27th, 2006, 01:36 PM
#3
Thread Starter
Not NoteMe
[RESOLVED] Re: [2.0] Threads sharing a variable
Thanks for your help, i managed to find a few relevent threads, knowing what i was looking for.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
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
|