Determine if Shift is down?

B

Ben Dilts

Using VB.NET, is there a way to determine if the Shift key
is down (or the Control key, etc.)?



~BenDilts( void );
 
J

Jay B. Harlow [MVP - Outlook]

Ben,
From a Control (remember Form is derived from Control). You can use the
Control.ModifierKeys property.

Control also has a Control.MouseButtons property to find the state of the
mouse buttons.

These are Shared/Static so they can be used when you do not have an instance
of a Control/Form.

Hope this helps
Jay
 
H

Herfried K. Wagner

Hello,

Ben Dilts said:
Using VB.NET, is there a way to determine if the Shift key
is down (or the Control key, etc.)?

\\\
Imports System.Windows.Forms
..
..
..
MsgBox((Control.ModifierKeys And Keys.Shift) = Keys.Shift)
///

Regards,
Herfried K. Wagner
 

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

Top