473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Determine if Shift is down?

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

~BenDilts( void );
Nov 19 '05 #1
2 7614
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

"Ben Dilts" <be*@agi.com> wrote in message
news:04****************************@phx.gbl...
Using VB.NET, is there a way to determine if the Shift key
is down (or the Control key, etc.)?

~BenDilts( void );

Nov 19 '05 #2
Hello,

"Ben Dilts" <be*@agi.com> schrieb:
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
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex Stevens | last post by:
Hi All, I'm writing a launcher program which checks for updates and copies them down to the client. However, I would like the user to be able to modify the settings for the launcher. As this...
6
by: PerryC | last post by:
I have search googles and there are hundreds of tips about AllowByPassKey... however, none works for me... well, perhaps I am too new to such high level functionality that it just does not make...
4
by: Paul T. RONG | last post by:
Dear All, I add two new tables to the database and then the disable shift key codes don't work. These two new tables are actually created by two queries, and only these two are in the front end,...
388
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
2
by: Matt Sawyer | last post by:
Hi, I'm attempting to do a drag and drop operation from one listbox to another. I have my listboxes setup with SelectionMode = MultiExtended so that I can use the shift key, cntrl key, etc. to...
1
by: mdb | last post by:
I want to determine whether the SHIFT key is depressed, but NOT during a key up/down/pressed event. How can I do that?
7
by: Csaba Gabor | last post by:
I'd like to detect the shift key when a button is "clicked" in Firefox/Mozilla. If the button is clicked with the mouse, no problem. However, if the onclick event is keyboard originated, then my...
0
by: Martijn Mulder | last post by:
/* I override IsInputKey() to direct the Arrow Keys (Cursor Keys) to my custom System.Windows.Forms.Control. But, holding down the Shift-Key prevents the Arrow Keys from coming through. How can...
3
by: zandiT | last post by:
hello i have a database that ive converted to an mde because its going on the network and will be accessd by various users. on the startup option i unticked all the options available so users...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.