424,054 Members | 1,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,054 IT Pros & Developers. It's quick & easy.

Proper Way to Update UI from Asynchronous Delegate

P: n/a
How do I update controls on my UI thread from the Asyncronous Delegate? I
understand it's not safe to just try to update it directly from the
asynchronous thread, but I need to figure out how to update it somehow.
Specifically I need to increment a ProgressBar and update text in a Label.

Thanks,
Michael C.
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
My name is Tyrone Hernandez. I grew up on the streets, so I'm familiar
with this kind of shiznit. I am down with this, and I'm going to keep it
real by top-posting.

In my hood, I have a homie named Shaniqua and some times she calls me on
the phone in an asynchronous fashion. Now I'm hip to her jive, so I don't
wanna just hang up. If I feels like talkin to Shaniqua, I talk to her. If
not, I use my power of "Control" to check "IsInvokeRequired" and if it is, I
call Control.BeginInvoke() to upgrade my progress bar.

Well, I'd be likin' to talk more, but my crack dealer is here so I'm
going to call some of his methods. Peace out!

"Michael C" <mi*******@optonline.net> wrote in message
news:OW******************@news4.srv.hcvlny.cv.net. ..
How do I update controls on my UI thread from the Asyncronous Delegate? I
understand it's not safe to just try to update it directly from the
asynchronous thread, but I need to figure out how to update it somehow.
Specifically I need to increment a ProgressBar and update text in a Label.

Thanks,
Michael C.

Nov 16 '05 #2

P: n/a
Yo yo yo T-Man,

How in the hiznell do I chizzeck da IsInvokeRequired and when do I use
BeginInvoke? Shaniqua used to be hot but now she a hood-rat. I wouldn't
give dat gyrl da time o' day. Tell me like I'm da poh-poh's, da five-oh's
or da metro's! I need a sample to get me hooked like da crack dealers
servin on 47th Ave.

Peace bro,
Michael C.

(To the tune of "I ain't mad at'cha" by Tupac):

"We was once two coders of da same kind/
Quick to hit the semi-colon at da same time/
You was stuck on VB but you still bold/
Bought Dot NET and hit da hood swolled"
"Tyrone Hernandez" <me**********@EvilHood.com> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...
My name is Tyrone Hernandez. I grew up on the streets, so I'm familiar
with this kind of shiznit. I am down with this, and I'm going to keep it
real by top-posting.

In my hood, I have a homie named Shaniqua and some times she calls me on the phone in an asynchronous fashion. Now I'm hip to her jive, so I don't
wanna just hang up. If I feels like talkin to Shaniqua, I talk to her. If
not, I use my power of "Control" to check "IsInvokeRequired" and if it is, I call Control.BeginInvoke() to upgrade my progress bar.

Well, I'd be likin' to talk more, but my crack dealer is here so I'm
going to call some of his methods. Peace out!

"Michael C" <mi*******@optonline.net> wrote in message
news:OW******************@news4.srv.hcvlny.cv.net. ..
How do I update controls on my UI thread from the Asyncronous Delegate? I understand it's not safe to just try to update it directly from the
asynchronous thread, but I need to figure out how to update it somehow.
Specifically I need to increment a ProgressBar and update text in a Label.
Thanks,
Michael C.


Nov 16 '05 #3

P: n/a
Michael C <mi*******@optonline.net> wrote:
How do I update controls on my UI thread from the Asyncronous Delegate? I
understand it's not safe to just try to update it directly from the
asynchronous thread, but I need to figure out how to update it somehow.
Specifically I need to increment a ProgressBar and update text in a Label.


See
http://www.pobox.com/~skeet/csharp/m...#windows.forms

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.