ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó©ñ¤Jform

[µo°Ý] ¦p¦ó©ñ¤Jform

½Ð±Ð¤j¤j¡A¥H¤U¦p¦ó©ñ¤Jform?¸Õ¤FÁÙ¬O¥X¤£¨ì®ÄªG...
The following example determines where the mouse is and whether the left mouse button and/or the SHIFT key is pressed. The x and y coordinates of the mouse pointer position are displayed in a label control as you move the mouse.

To try the example, add the following event procedure to a form that contains a label named Coordinates:

Private Sub Detail_MouseMove(Button As Integer, _
     Shift As Integer, X As Single, 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

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

Detail   §ï¦¨  §Aªºªí³æ¦WºÙ   ¦p¡G  UserForm
¬O¾Çµ{¦¡¦Ó¤£¬O­nµ{¦¡¡A¬O¶i¨Bªº°ò¦

TOP

¦^´_ 2# ·t¶Â


    ÁÂÁ¤j¤j!½Ð«ü±Ð¨º¸Ì¿ù...
·Æ¹«®y¼Ð.rar (11.22 KB)

TOP

§ï¥Î³o¤@­Ó
§Ú¨S§ïµ{¦¡½X¡AÁÙ¬O¸ò¤W¦¸¦^ÂФ@¼Ë¡A¥u¬O§ó§ï©pªº¨Æ¥óÅX°Ê
¥t...§Ú¬O¥Î µ{¦¡½s¿èµ¡µø¤Wªº¨Æ¥ó¬D¿ï¾¹
§Ú´ú¸Õ¹L  ·Æ¹«ªº§¤¼Ð·|¦b  label ¤W Åã¥Ü(¨ä¥L¨S¸Õ)¡A¦³°ÝÃD¦b»¡§a
  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
½Æ»s¥N½X
¬O¾Çµ{¦¡¦Ó¤£¬O­nµ{¦¡¡A¬O¶i¨Bªº°ò¦

TOP

¦^´_ 4# ·t¶Â


    ¦¨¤F!ÁÂÁ¤j¤j!

TOP

        ÀR«ä¦Û¦b : ­ì½Ì§O¤H´N¬Oµ½«Ý¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD