|
|
Title | Display a child form over a topmost parent form |
Description | This example shows how to display a child form over a topmost parent form in Visual Basic 6. |
Keywords | stretch, image, resize |
Categories | Controls, 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
|
|
|
|
|
|