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 an MDI form on top of other programs
Keywordsform, top, on top, topmost, ontop
CategoriesAPI, Tips and Tricks, Controls
 
Use the SetWindowPos API function to make the window a topmost window.
 
Private Sub OnTopCheck_Click()
    If OnTopCheck.Value = vbChecked Then
        SetWindowPos MDIForm1.hwnd, _
            HWND_TOPMOST, 0, 0, 0, 0, _
            SWP_NOMOVE + SWP_NOSIZE
    Else
        SetWindowPos MDIForm1.hwnd, _
            HWND_NOTOPMOST, 0, 0, 0, 0, _
            SWP_NOMOVE + SWP_NOSIZE
    End If
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated