请问“不拖动标题栏,而是通过在表单上按下鼠标左键来移动表单”这段代码为啥报错?
请问“不拖动标题栏,而是通过在表单上按下鼠标左键来移动表单”这段代码为啥报错?源代码见附件
通过在表单上按下鼠标左键来移动表单.rar
(2.91 KB)
通过在表单或表单内的控件上按下鼠标左键来移动窗口
*(而不是通过在标题栏上按下鼠标左键来移动窗口)
*-----------------------------------------------
*表单的Init事件代码:
Declare Long ReleaseCapture In "user32"
Declare Long SendMessageA In "user32" Long HWnd,Long wMsg,Long wParam,String Lparam
This.MySetMouseDown(Thisform)
*表单的MouseDown事件代码:
Lparameters nButton, nShift, nXCoord, nYCoord
ReleaseCapture()
SendMessageA(This.HWnd,0xA1,2,0)
*为表单新建一方法 MySetMouseDown,其代码为:
Lparameters toControl
If Pemstatus(toControl,"MouseDown",5) And toControl<>Thisform
Bindevent(toControl,"MouseDown",Thisform,"MouseDown")
Endif
If Type("toControl.objects[1]")="O"
Local loI
For Each loI In toControl.Objects
This.MySetMouseDown(loI)
Endfor
Endif