473,387 Members | 1,456 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.

Capturing control keys

Hi

How can I capture control keys Ctrl-A, Ctrl-B, Ctrl-C etc. in a form?

Thanks

Regards
Jun 27 '08 #1
2 3078
On Apr 21, 12:01 am, "John" <i...@nospam.infovis.co.ukwrote:
Hi

How can I capture control keys Ctrl-A, Ctrl-B, Ctrl-C etc. in a form?

Thanks

Regards
John,
First set keypreview property of your form to "True", then:

Private Sub Form1_keydown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyData = Keys.Control + Keys.A Then
MsgBox("Ctrl+A pressed")
ElseIf e.KeyData = Keys.Control + Keys.B Then
MsgBox("Ctrl+B pressed")
ElseIf e.KeyData = Keys.Control + Keys.C Then
MsgBox("Ctrl+C pressed")
End If

Hope this helps,

Onur Güzel
End Sub
Jun 27 '08 #2
\\\
Private Sub Form1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs)
Handles Me.KeyUp
Dim i = e.KeyData
End Sub
///

Cor

"John" <in**@nospam.infovis.co.ukschreef in bericht
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi

How can I capture control keys Ctrl-A, Ctrl-B, Ctrl-C etc. in a form?

Thanks

Regards
Jun 27 '08 #3

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

Similar topics

4
by: Vazz | last post by:
I am trying to capture the key combination "Control + Shift + Enter" in a KeyDown event. I am able capture "Control + Enter" using (e.KeyCode == Keys.Enter && e.Modifiers == Keys.Control). How do I...
0
by: veena | last post by:
hello, i have got a problem of how to capture two keys when pressed together i.e in my task i require certain action to be performed when the ctrl and 'A' keys are pressed together i.e i need to...
2
by: JPSutor | last post by:
I need to capture multiple keys with the keyUp event (Ex. Tab + 7) I can captuee individual keys by I'm not sure how to caputre multiple keys
2
by: Phil Galey | last post by:
I'm using the ProcessCmdKey event to capture various keys that are pressed. However, I'm having trouble capturing the combination of the CTRL key and, say, the DOWN key. If I just press the CTRL...
2
by: Sagaert Johan | last post by:
Hi I have a usercontrol , the keypress and keyup/down events do not seem to work on the cursor keys . How can i capture the cursor keys when my control has the focus ? Johan
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
2
by: senfo | last post by:
Hello all, To help alleviate human error, I'm developing an application that uses a barcode reader to fill in a value in a TextBox control. The barcode reader is connected to the PC through the...
2
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
I have a tabcontrol where I want to capture the CTRL+C key combination. My tabcontrol has on its tabpages some treeView controls. My intention is to intercept the event of pressing the CTRL+C when...
6
by: mbewers1 | last post by:
I've never handled keysroke events before and I would like to implement a Return keystroke event in a Windows form to bring up a list of items in a datagrid as well as habing a search button in the...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.