Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

How do I update a control from another thread?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- 29 Oct 2004 20:21 GMT
Hello all,
I have read a lot about that I can't do something like

TextBox1.text ="abc"

if I am not in the gui thread. Can someone explain what
I actually need to do?

Tia
Herfried K. Wagner [MVP] - 29 Oct 2004 20:30 GMT
<guy> schrieb:
> I have read a lot about that I can't do something like
>
> TextBox1.text ="abc"
>
> if I am not in the gui thread. Can someone explain what
> I actually need to do?

Always show your forms in the app's main UI thread and use 'Control.Invoke'
to communicate in the thread -> UI direction:

Multithreading:

<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms08162002.asp>
<URL:http://msdn.microsoft.com/library/en-us/dnforms/html/winforms01232003.asp>

<URL:http://www.devx.com/dotnet/Article/11358/>

<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsContro
lClassInvokeTopic.asp
>

Multithreading in Visual Basic .NET (Visual Basic Language Concepts)
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconthreadinginvisualbasic.asp>

Sample:

<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/downloads/FileSystemEnumerator.zip>

If you have any further questions, feel free to ask them.

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

- 29 Oct 2004 23:37 GMT
These examples are rather complicated. I will have to spend
a whole day just to understand how to calculate pi and this
misses the point. O.k. Can you please explain as breifly as
possible what I need to do (and why) in order to update
a textbox from a worker thread.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.