-
Thanks marnitzg and Megatron for your useful advices.
But still the problem is not completely solved.
In fact I dun understand exactly what the code means:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
I think it might be calling the Win32 API to set the window position. So I put it in the general declaration of the toolwindow form.
I add the code:
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, &H1 Or &H2
to the Form_Load. But the problem is :
when I try minimize the main form several times, the toolwindow forms appear at the back of the main form again and I suspect the reason might be the toolwindow forms have already loaded but just set the invisible. So next time the main window resizes to orginal, the setwindowpos function has not been called in the Form_Load of the toolwindows forms.
So is there any solution to this.
-
Code:
SetWindowPos frmtool1.hwnd, -1, 0, 0, 0, 0, 3
When you show the toolbar form, call this again.
Put the declare in the main form's declarations. Then whenever you do :
add the above code after it.