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 / August 2006

Tip: Looking for answers? Try searching our database.

TopMost - affects realtime?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob R. Ainscough - 11 Aug 2006 22:08 GMT
Suppose I have a form that loads with TopMost = True.  If I change the form
to TopMost = False will it immediately affect the form -- in other words is
TopMost dynamic?  The reason I ask is that I want to disable TopMost when
I'm displaying a Msgbox (otherwise the message box appears behind my form).

Rob.
Mini-Tools Timm - 12 Aug 2006 14:42 GMT
> Suppose I have a form that loads with TopMost = True.  If I change the form
> to TopMost = False will it immediately affect the form -- in other words is
> TopMost dynamic?  The reason I ask is that I want to disable TopMost when
> I'm displaying a Msgbox (otherwise the message box appears behind my form).

Yes, TopMost works immediately.  If you want to ensure the other form you
are showing appears above the current form, you can:

    Form form = new Form();
    form.Text = "Test";
    this.TopMost = false;
    form.ShowDialog();
    this.TopMost = true;

Note that if you show the other form with the Show() method instead of
ShowDialog(), then the "this.TopMost = true" line will execute immediately,
and your other form will not appear above your main form.  In this case, the
only way to ensure the other form appears on top is to set its TopMost
property to true.

Signature

Timm Martin
Mini-Tools
.NET Components and Windows Software
http://www.mini-tools.com


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.