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
 
 
 
 
 
 
TitleDisplay a child form over a topmost parent form
DescriptionThis example shows how to display a child form over a topmost parent form in Visual Basic 6.
Keywordsstretch, image, resize
CategoriesControls, API
 
Thanks to Evan Toder.

It's non-trivial to display a child form over a topmost form. If you simply display the child form as you normally would, it sits below its topmost parent.

To make the child form remain over the parent form, you must make it topmost, too.

 
' Show the child form above this one.
Private Sub cmdShowChild_Click()
Dim frm As New Form2

    ' Make the child topmost, too.
    SetWindowPos frm.hwnd, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER

    ' Display it.
    frm.Show vbModeless, Me
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated