Re: Cross-thread operation not valid
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Thu, 23 Jun 2005 19:03:05 +0100
Mikael Syska <news04@xxxxxxxx> wrote:
> Cross-thread operation not valid: Control 'ThreadStartedAt' accessed
> from a thread other than the thread it was created on
>
> I get this Exception when I try to update some labels/textbox's from a
> Thread... I have read something about that I can use Delegates/Invoke
> and stuff in that direction, but I'm not that far in my book now that I
> understand how all that works....
>
> Is there any one here that can give a very simple example, I can use in
> my Program to update some controls on my form from a Thread?
You can't, directly. You have to call Control.Invoke/BeginInvoke to do
the actual update on the UI thread.
See http://www.pobox.com/~skeet/csharp/winforms.shtml
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.
- References:
- Cross-thread operation not valid
- From: Mikael Syska
- Cross-thread operation not valid
- Prev by Date: Re: Serialport Class: SerialDataReceivedEventHandler
- Next by Date: Re: Application just run on development-system
- Previous by thread: Re: Cross-thread operation not valid
- Next by thread: myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe 10.0.0.1"; blank is not allowed?
- Index(es):
Relevant Pages
|
Loading