R
richboy2002
Unregistered / Unconfirmed
GUEST, unregistred user!
我按书中所说,在vb中添加了一个command1控件,加入如下代码:
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 nParam As Long
With Command1
If X > 0 And X < 100 then
nParam = HTLEFT
else
If X > .Width - 100 And X < .Width then
nParam = HTRight
End If
If nParam then
Call ReleaseCapture
Call SendMessage(.hwnd, WM_NCLBUTTONDOWN, nParam, 0)
End If
End With
End Sub
但好象并不能实现书中所说的!!请问是怎么回事??请赐教!(该段代码的目的是为了在
运行环境下能拖动command控件,使其左右大小能变动)
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 nParam As Long
With Command1
If X > 0 And X < 100 then
nParam = HTLEFT
else
If X > .Width - 100 And X < .Width then
nParam = HTRight
End If
If nParam then
Call ReleaseCapture
Call SendMessage(.hwnd, WM_NCLBUTTONDOWN, nParam, 0)
End If
End With
End Sub
但好象并不能实现书中所说的!!请问是怎么回事??请赐教!(该段代码的目的是为了在
运行环境下能拖动command控件,使其左右大小能变动)