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 / July 2004

Tip: Looking for answers? Try searching our database.

Creating a window in a new thread

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joshua Ellul - 05 Jul 2004 13:01 GMT
Hi There,

I want to create a window in a thread of its own how can I do this?

Regards,

Joshua
AlexS - 05 Jul 2004 14:01 GMT
Hi, Joshua

You can do that in exactly same way as you do on main UI thread.
Basically this means you have to create Form and use Application.Run on it.
This will start separate message pump for your thread.
At the same time you must keep in mind that communication and
synchronization between UI threads is not so simple as when you have only
one UI thread. See Invoke/BeginInvoke methods for resp. controls and
threading topics in MSDN for .Net.

HTH
Alex

> Hi There,
>
[quoted text clipped - 3 lines]
>
> Joshua
Herfried K. Wagner [MVP] - 05 Jul 2004 20:20 GMT
* "AlexS" <salexru2000NO@SPAMsympaticoPLEASE.ca> scripsit:
> You can do that in exactly same way as you do on main UI thread.
> Basically this means you have to create Form and use Application.Run on it.
[quoted text clipped - 3 lines]
> one UI thread. See Invoke/BeginInvoke methods for resp. controls and
> threading topics in MSDN for .Net.

Mhm...  I still would try to avoid that and create the UI in the main
thread and then use invoke to communicate with the UI.

Signature

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

Joshua Ellul - 07 Jul 2004 15:25 GMT
The problem is that I have an ActiveX component created in VB, in which I
need to make several instances of the component in different threads.  Is it
possible to instantiate a component without adding it to a form?

Josh

> * "AlexS" <salexru2000NO@SPAMsympaticoPLEASE.ca> scripsit:
> > You can do that in exactly same way as you do on main UI thread.
[quoted text clipped - 11 lines]
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/

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.