【VB】点击控件移动窗体 2017-04-07 VB VB 0 Comments Word Count: 90(words) Read Count: 1(minutes)本文为旧博客迁移的文章123456789101112131415'窗口移动APIPrivate Declare Function ReleaseCapture Lib "user32" () As LongPrivate Declare Function SendMessage Lib "user32" Alias _"SendMessageA" (ByVal hwnd As Long, ByVal _wMsg As Long, ByVal wParam As Long, _lParam As Any) As LongPrivate Const WM_SYSCOMMAND = &H112Private Const SC_MOVE = &HF010&Private Const WM_NCLBUTTONDOWN = &HA1Private 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