- 帖子
- 62
- 主題
- 10
- 精華
- 0
- 積分
- 253
- 點名
- 0
- 作業系統
- xp , win7
- 軟體版本
- office2003
- 閱讀權限
- 20
- 性別
- 男
- 來自
- 人心
- 註冊時間
- 2010-5-21
- 最後登錄
- 2012-8-3
|
4#
發表於 2010-11-12 08:14
| 只看該作者
改用這一個
我沒改程式碼,還是跟上次回覆一樣,只是更改妳的事件驅動
另...我是用 程式編輯窗視上的事件挑選器
我測試過 滑鼠的坐標會在 label 上 顯示(其他沒試),有問題在說吧- Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
- Dim intShiftDown As Integer, intLeftButton As Integer
- Me!Coordinates.Caption = X & ", " & Y
- ' Use bit masks to determine state of
- ' SHIFT key and left button.
- intShiftDown = Shift And acShiftMask
- intLeftButton = Button And acLeftButton
- ' Check that SHIFT key and left button
- ' are both pressed.
- If intShiftDown And intLeftButton > 0 Then
- MsgBox "Shift key and left mouse button were pressed."
- End If
- End Sub
複製代碼 |
|