VB中控制窗体位置方法

来源:互联网 发布:mac a1181 编辑:程序博客网 时间:2024/04/27 17:48
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★窗体前置或后置
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)
' 上面为窗口置前声明

' 窗口置前
'Dim myval As Integer
myval = SetWindowPos(Form1.hwnd, -1, 0, 0, 0, 0, 3)

'窗口正常
'Dim myval As Integer
myval = SetWindowPos(Form1.hwnd, -2, 0, 0, 0, 0, 3)


'窗口置后
'Dim myval As Integer
myval = SetWindowPos(Form1.hwnd, 1, 0, 0, 0, 0, 3)
'★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★窗体前置或后置

原创粉丝点击