473,322 Members | 1,480 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,322 software developers and data experts.

Capturing Control + Shift + Enter

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
check if there are two Modifiers?
Nov 15 '05 #1
4 15276
Vazz wrote:
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
check if there are two Modifiers?


if (e.KeyCode == Keys.Enter && e.Control && e.Shift) {

}

Vadim Chekan.

Nov 15 '05 #2
Vadim Chekan wrote:
Vazz wrote:
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
check if there are two Modifiers?

if (e.KeyCode == Keys.Enter && e.Control && e.Shift) {

}

Vadim Chekan.


Doesn't that need to be a bitwise AND?

if (e.KeyCode == (Keys.Enter & e.Control & e.Shift) )
{
}

Nov 15 '05 #3
Thanks guys. Its actually ((e.KeyCode == Keys.Enter) && e.Shift &&
e.Control). Works now.

Vazz
Tyler Dixon <td****@telus.net> wrote in message news:<Utivb.109592$jy.52160@clgrps13>...
Vadim Chekan wrote:
Vazz wrote:
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
check if there are two Modifiers?

if (e.KeyCode == Keys.Enter && e.Control && e.Shift) {

}

Vadim Chekan.


Doesn't that need to be a bitwise AND?

if (e.KeyCode == (Keys.Enter & e.Control & e.Shift) )
{
}

Nov 15 '05 #4
Tyler Dixon wrote:
Doesn't that need to be a bitwise AND?

if (e.KeyCode == (Keys.Enter & e.Control & e.Shift) )


No!
"Bitwize AND" of two bool variables (e.Control & e.Shift) it not wise!

Vadim Chekan.

Nov 15 '05 #5

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

Similar topics

2
by: ansi_c | last post by:
hello, I just developed an .adp application linked to SQL Server 7, I compiled it disabling also all the shortcuts from the tools->startup menu and obtained an .ade project. My problem is that...
4
by: carmela_wong | last post by:
How can I protect my database so that the end user needs to open it using Shift+Enter? Thanks
1
by: ray | last post by:
Hi, Now, I have a datagrid with data input. The data type is nvarchar. While I press "SHIFT+ENTER", it moves to a new row for the same data row. Can I prevent it from happening? Thanks a lot,...
2
by: pemigh | last post by:
Client's fingers have been well trained on another application to wrap lines by hitting shift-enter, and wants the same in Access application. Changing "enter key behavior" for controls is not...
1
eboyjr14
by: eboyjr14 | last post by:
I need to make it so that when you're entering data into a textarea, and press shift+enter it creates a new line where the caret is at, then when you press enter it sends a message. This is like most...
4
by: Johnny J. | last post by:
How do you check if the Control, Shift or Alt key is pressed at any given time (not necessarily in a keyevent)? Cheers, Johnny J.
2
by: Sunfire | last post by:
I was wondering if there was a way to hit enter to insert blank lines while in the designer? I tried this but all it seems to want to do is insert code that really shouldn't be there. For example,...
0
by: Jacob | last post by:
I'm just trying VS2005 in Vista and have noticed that the control+shift+ right or left arrow functionality is different than expected (highlight work next to cursor). I think this is a vista...
9
by: dale5804 | last post by:
poss a silly question, but basically i have a database where its properties mean when it is opened (enter / double click) the actual database, and options (file/edit/...etc) are hidden and only the...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.