VB点击控件移动窗体

前端之家收集整理的这篇文章主要介绍了VB点击控件移动窗体前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
'窗口移动API
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long,ByVal _
wMsg As Long,ByVal wParam As Long,_
lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MOVE = &HF010&
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2

Private Sub command1_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
   ReleaseCapture
   SendMessage hwnd,WM_NCLBUTTONDOWN,HTCAPTION,0&
End Sub
原文链接:https://www.f2er.com/vb/256732.html

猜你在找的VB相关文章