Form always on top
Posted on 1999-08-16
I have two forms, one main form and one child form. Both are normal forms (no mdi) and I set the one form as a child of the other with the Function:
Declare Function SetParent& Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long)
i = SetParent(CHildForm.hWnd, MainForm.hWnd)
So far, so good!
But now I want to force the child form always be on top of the main form. If I use the API-function
Declare Function SetWindowPos Lib "user32" (ByVal h&, ByVal hb&, ByVal x&, ByVal y&, ByVal cx&, ByVal cy&, ByVal f&) As Long
Public Function SetTopWindow(hWnd As Long, bState As Boolean) As Boolean
If bState = True Then
SetTopWindow = SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
ElseIf bState = False Then
SetTopWindow = SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
Debug.Print "bState unbekannt."
SetTopWindow = False
,my child window is tiny small.
Does anyone know what to do?
Plaese post only comments as long as I tell s.o. to post as an answer
Thanx in advance