[求助]控件移动的问题
请问高手,如何实现象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
Dim nodeText As Node
然后在控件的MouseDown事件里填上这段代码
If Button = 1 Then
ReleaseCapture '移动控件
SendMessage cm(Index).hwnd, &HA1, 2, 0&
End If
这样运行时鼠标左键按下时就可以把控件拖到你想要的地方去了