Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post

    VB: Holding The Shift Key.

    Now, all I need to know is the correct KeyCode for the shift key so I can put it in the if statements.
    Code:
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      If Shift = vbKeyShift Then
        BlnHoldShift = True
      End If
    End Sub
    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
      If Shift = vbKeyShift Then
        BlnHoldShift = False
      End If
    End Sub

  • #2
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    My Bad

    I got it fixed

    My Text box was highlighted so I changed Form_etc... to TextBox_ert...

    and

    I changed shift = vbshiftkey to shift = 1

    Though I did have to use shift = 0 for key up


    I am done now.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •