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

Re: Adding Control to a Form from another thread by Stoitcho

Stoitcho
Tue Apr 04 13:50:42 CDT 2006

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.


--
HTH
Stoitcho Goutsev (100)

"Dan, Vascas" <Dan@noemailcom> wrote in message
news:%239BjFQBWGHA.4960@TK2MSFTNGP12.phx.gbl...
> 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
>



Re: Adding Control to a Form from another thread by Dan,

Dan,
Tue Apr 04 14:52:06 CDT 2006

Thanks for the reply Goutsev.
Can you please provide me an example.
I know very little about vb.net.

Dan

"Stoitcho Goutsev (100)" <100@100.com> wrote in message
news:%23ebYXgBWGHA.4720@TK2MSFTNGP15.phx.gbl...
> 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.
>
>
> --
> HTH
> Stoitcho Goutsev (100)
>
> "Dan, Vascas" <Dan@noemailcom> wrote in message
> news:%239BjFQBWGHA.4960@TK2MSFTNGP12.phx.gbl...
>> 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
>>
>
>



Re: Adding Control to a Form from another thread by Herfried

Herfried
Tue Apr 04 15:49:21 CDT 2006

"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>

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