Results 1 to 3 of 3

Thread: Detecting Left Mouse Button and Shift

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    Tennessee
    Posts
    279

    Detecting Left Mouse Button and Shift

    How can I determine when the left mouse button and shift key are pressed at the same time?
    A cynic knows the price of everything but the value of nothing.

  2. #2
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Code:
    If Me.MouseButtons.Left And Me.ModifierKeys = Keys.Shift Then
            msgbox("You pressed the shift key and click the left mouse button")      
    End If
    Put this in whatever event you'd like

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    Tennessee
    Posts
    279
    I wound up putting this code in the mousedown event of my datagrid control:

    If e.Button = MouseButtons.Left And Me.ModifierKeys =
    _Keys.Shift Then
    MsgBox("You pressed Shift + Left Mouse Button")
    End If
    A cynic knows the price of everything but the value of nothing.

Posting Permissions

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



Click Here to Expand Forum to Full Width