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

Tip: Looking for answers? Try searching our database.

Easily set TopMost for all forms in a project?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
james - 28 Mar 2007 18:00 GMT
I have a project with 50+ forms that needs to be made topmost. Is
there a faster way than manually setting topmost=true for all forms in
the project? Then how do I guarantee that dialogs get set topmost?

Thanks,
James
Wibberlet - 30 Mar 2007 16:26 GMT
Hi James,

I am intrigued as to why you would want to do this in the first place?

When you set a form's TopMost property to true then it will display above
all other forms that do not have their TopMost property set. If multiple
forms are displayed at the same time, all with their TopMost property set,
then they will essentially all have equal precedence. i.e. clicking any of
the forms will bring it to the top of the z-order and display it above all
others.

There is a difference with dialogues when using the ShowDialog() method.
When this method is called from a window that has its TopMost property set,
the corresponding form will always be displayed at the top of the z-order, In
addition, if it is a modal dialogue, other forms cannot receive focus whilst
it is being displayed.

If ShowDialog() is called from a form that does not have its topMost
property set then it will be displayed below any forms that do have their
TopMost property set. It can of course still be modal and this may produce
non-intuitive states where a modal form requires input but cannot be seen.

You can control this to some extent within your own application but
interesting combinations can arise where other applications use the TopMost
property themselves.

Perhaps you can determine another way of configuring your application or if
not, describe your requirement in a little more detail.

regards - wibberlet
Development blog at http://wibberlet.blogspot.com

================================================

> I have a project with 50+ forms that needs to be made topmost. Is
> there a faster way than manually setting topmost=true for all forms in
> the project? Then how do I guarantee that dialogs get set topmost?
>
> Thanks,
> James

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.