欢迎大家访问我的网站!

VB设置外部窗体的位置跟大小

思博2023-09-09 23:33:45254编程开发

Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As String) As Long

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

Private Sub Command1_Click()

Dim WindowHandle As Long

WindowHandle = FindWindow(vbNullString, "data:, - Google chrome")   'QQ2009 改为你的窗体的标题 SetWindowPos WindowHandle, -1, 0, 0, 2000, 2000, &H40 '2000,2000 是你要设置窗口的大小 End Sub

SetWindowPos WindowHandle, 0, 0, 0, 350, 350, &H40 '2000,2000

End Sub


转载声明:本站发布文章及版权归原作者所有,转载本站文章请注明文章来源!

本文链接:http://lxkj.vip/?id=96

网友评论