新建From1(窗体),新建Command1到3(按钮CommandButton),代码:
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)
Private Sub Command1_Click()
' 窗口置前
Dim myval
myval = SetWindowPos(form1.hwnd, -1, 0, 0, 0, 0, 3)
End Sub
Private Sub Command2_Click()
'窗口正常
Dim myval
myval = SetWindowPos(form1.hwnd, -2, 0, 0, 0, 0, 3)
End Sub
Private Sub Command3_Click()
'窗口置后
Dim myval
myval = SetWindowPos(form1.hwnd, 1, 0, 0, 0, 0, 3)
End Sub