Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleKeep a form on top of all others in Visual Basic .NET
DescriptionThis example shows how to keep a form on top of all others in Visual Basic .NET.
Keywordstop most, topmost, on top, ontop, Form, VB.NET
CategoriesVB.NET, Tips and Tricks, Controls
 
In Visual Basic 6, making a form stay on top of all others is a bit of a hassle, requiring that you use an API function. In Visual Basic .NET, it's easy. Simply set the form's TopMost property to True either at design time or at run time.

The following code switches the form's TopMost property when the user checks or unchecks the chkTopmost check box.

 
Private Sub chkTopmost_CheckedChanged(ByVal sender As _
     System.Object, ByVal e
As System.EventArgs) Handles chkTopmost.CheckedChanged
    Me.TopMost = chkTopmost.Checked
End Sub
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated