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 / Windows Forms / WinForm General / April 2006

Tip: Looking for answers? Try searching our database.

Adding Control to a Form from another thread

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan, Vascas - 04 Apr 2006 19:17 GMT
In the background I want to load some control after form loaded.
I tried threading but it does not allow me to add control because current
thread have not created the form.

Also please tell me what BackGroundWorker control suppose to do.

How do I do it.
Please advise me.

Thanks, Dan
Stoitcho Goutsev (100) - 04 Apr 2006 19:50 GMT
Dan,
you need ot use Control.Invoke to marshal the code for creating the control
and adding it to the form to the UI thread.

Signature

HTH
Stoitcho Goutsev (100)

> In the background I want to load some control after form loaded.
> I tried threading but it does not allow me to add control because current
[quoted text clipped - 6 lines]
>
> Thanks, Dan
Dan, Vascas - 04 Apr 2006 20:52 GMT
Thanks for the reply Goutsev.
Can you please provide me an example.
I know very little about vb.net.

Dan

> Dan,
> you need ot use Control.Invoke to marshal the code for creating the
[quoted text clipped - 10 lines]
>>
>> Thanks, Dan
Herfried K. Wagner [MVP] - 04 Apr 2006 21:49 GMT
"Dan, Vascas" <Dan@noemailcom> schrieb:
> In the background I want to load some control after form loaded.
> I tried threading but it does not allow me to add control because current
> thread have not created the form.
>
> Also please tell me what BackGroundWorker control suppose to do.

In addition to the other replies, I suggest to check out the following
resources:

Multithreading in Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=en>

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>


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.