返回列表 上一主題 發帖

[發問] 如何放入form

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Detail   改成  你的表單名稱   如:  UserForm
是學程式而不是要程式,是進步的基礎

TOP

改用這一個
我沒改程式碼,還是跟上次回覆一樣,只是更改妳的事件驅動
另...我是用 程式編輯窗視上的事件挑選器
我測試過  滑鼠的坐標會在  label 上 顯示(其他沒試),有問題在說吧
  1. Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)



  2.     Dim intShiftDown As Integer, intLeftButton As Integer

  3.     Me!Coordinates.Caption = X & ", " & Y
  4.     ' Use bit masks to determine state of
  5.     ' SHIFT key and left button.
  6.     intShiftDown = Shift And acShiftMask
  7.     intLeftButton = Button And acLeftButton
  8.     ' Check that SHIFT key and left button
  9.     ' are both pressed.
  10.     If intShiftDown And intLeftButton > 0 Then
  11.         MsgBox "Shift key and left mouse button were pressed."
  12.     End If


  13. End Sub
複製代碼
是學程式而不是要程式,是進步的基礎

TOP

        靜思自在 : 【時間如鑽石】時間對一個有智慧的人而言,就如鑽石般珍貴;但對愚人來說,卻像是一把泥土,一點價值也沒有。
返回列表 上一主題