Shift/Ctrl in the OnMouseUp Sub

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

I have created a UserControl and now I need to Override the OnMouseUp,
OnMouseDown, and OnMouseClick Subs but I also need to know if the Shift or
Ctrl key was pressed when the mouse action happened. How can I do that

Thanks
Fred
 
Hi Fred,

You can use the ModifierKeys property of the Control base class.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Fred said:
I have created a UserControl and now I need to Override the
OnMouseUp, OnMouseDown, and OnMouseClick Subs but I also need to
know if the Shift or Ctrl key was pressed when the mouse action
happened. How can I do that


System.Windows.Forms.Control.ModifierKeys()

is a shared property you can evaluate in the procedure.


Armin
 
Fred said:
I have created a UserControl and now I need to Override the OnMouseUp,
OnMouseDown, and OnMouseClick Subs but I also need to know if the Shift or
Ctrl key was pressed when the mouse action happened. How can I do that

\\\
If CBool(Control.ModifierKeys And Keys.Control) Then
...
End If
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top