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 / February 2007

Tip: Looking for answers? Try searching our database.

Windows Forms advice

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
abhiM - 16 Feb 2007 16:45 GMT
Hi,
   This is a very general question. I am about to embark on
developing a new application (Windows Forms based). All the business
logic, external interfaces etc have already been developed and are
available as ready to use libraries.
   This application is going to be multi-threaded. Is it recommended
to have each of the different forms or at least a couple of related
forms packaged into separate libraries. Is such a packaging going to
have any effect on the multi-threaded nature of the application. This
is the first time I am using threading and I need to use threads to
display the status of some of the devices in the system in real time.
  Any recommendations and any advice is greatly appreciated.

Thanks,
AM
Kevin Spencer - 16 Feb 2007 19:14 GMT
A Windows Forms application runs in a Single-Threaded Apartment model, with
a single thread handling the execution of the UI. Any threading you do will
have to be done by non-UI classes. Putting various forms into different
assemblies has no effect on the application, though.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

I had the same problem once. Fixed it using the same solution.

> Hi,
>    This is a very general question. I am about to embark on
[quoted text clipped - 11 lines]
> Thanks,
> AM
Stoitcho Goutsev (100) - 19 Feb 2007 16:23 GMT
abhiM,

Physical deploinment of your application has nothing to do with the
multithreading. Yes you can have different controls/classes from different
assemblies together in a multithread application. At the very end they all
get laoded into the memory allocated to the same process. However Windows
Forms UI is very much thread sensitive - you cannot modify the UI from a
thread different than the UI thread created the control. In order to do that
you need to marshal UI related calls from worker threads to the main UI
thread. This is mesically done via Control.InvokeRequired,Control.Invoke
and/or Control.BeginInvoke members. How to properly update the UI in a
multithread application has been discussed a lot in the newsgroups, forums
and blogs. I believe you can find easely good information and guidelines on
the web.

Signature

HTH
Stoitcho Goutsev (100)

> Hi,
>    This is a very general question. I am about to embark on
[quoted text clipped - 11 lines]
> Thanks,
> AM

Rate this 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.