拖动无标题栏的窗体

作者在 2007-05-06 18:09:00 发布以下内容

'************************************API函数声明****************************************************
Private Declare ReleaseCapture Lib "user32" () As Long
Private Declare SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
'***************************************************************************************************

'下面实现窗体的拖动(因为没有标题栏)
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
       ReleaseCapture
       SendMessage Me.hwnd, &HA1, 2, 0
    End If
End Sub

默认分类 | 阅读 1539 次
文章评论,共0条
游客请输入验证码
浏览588076次