马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
该组件可以实现鼠标的按下、弹起、双击和移动的事件捕捉。具体的效果可以使用下面的例子演示。
注意:Enabled属性设置为True表示允许事件的触发,之后一定要将其设置为False,表示不再处理。

- [FONT=courier new]
- 引用EFAN Hook AutoCAD Tool Library 1.0动态链接库。
- Private WithEvents ehObj As EFHook.Hook
- Private Sub ehObj_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
- ThisDrawing.ModelSpace(0).TextString = Round(ehObj.ConvertScreenToWorldX(X, Y) + 0.0000000001, 4) & ", " & Round(ehObj.ConvertScreenToWorldY(X, Y) + 0.0000000001, 4)
- ThisDrawing.ModelSpace(0).Update
- End Sub
- Private Sub test()
- On Error GoTo ErrTrap
- Set ehObj = New Hook
- ehObj.Enabled = True
- ThisDrawing.Utility.GetPoint
- ehObj.Enabled = False
- Set ehObj = Nothing
- Exit Sub
-
- ErrTrap:
- ehObj.Enabled = False
- Set ehObj = Nothing
- End Sub
- [/FONT]
|