473,503 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handle Ctrl key and Enter Key

7 New Member
I want to focus another control when I press both Ctrl key and Enter Key in a text box. How can I do this?
Jul 31 '10 #1
3 1745
Guido Geurs
767 Recognized Expert Contributor
This code jumps to Command3 if CTRL and ENTER are pressed in Text1.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
  2.    If KeyCode = vbKeyReturn And Shift = 2 Then
  3.       Command3.SetFocus
  4.    End If
  5. End Sub
  6.  
Jul 31 '10 #2
mohanty2050
7 New Member
@ggeu
How can I use this code in Text1_KeyPress() event?
Aug 2 '10 #3
Guido Geurs
767 Recognized Expert Contributor
You can't use this with Keypress because it controls only on 1 key= KeyAscii
Private Sub Text1_KeyPress(KeyAscii As Integer)
Aug 2 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
4366
by: Deano | last post by:
I think that just about sums it up. Is there a fix/workaround for this?It's quite annoying behaviour and not user-friendly.thanksMartin
0
1415
by: Coder | last post by:
hi, i am using a c# windows application. i want to handle some keypress events like ctrl+A, shift+enter, etc.. is it easy to handle only one keypress; as KeyPressEventArgs e;... e.KeyPress. ...
3
23223
by: Coder | last post by:
hi, there is still no answer, i wonder if there is a way to handle the multiple key-press event on a C# windows form, like "Ctrl+Enter"
15
4011
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
3
2949
by: yuelinniao | last post by:
hi, I have got a simple way to make "textarea" support "auto-submit" when pressing Ctrl+Enter, and tested under both IE and Firefox. The common old method is like this: <form name=form2>...
3
5830
by: Basel | last post by:
Hi All I'm using SetConsoleCtrlHandler to handle Ctrl-C event. But I have a problem using it in multi-threaded applications (it doesn't invoke handler function). What is the correct way to...
4
8604
by: sravan_reddy001 | last post by:
i had designed a win app(an address book) when the user wants to enter the contact he will type in all the details and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED" i want to simplify this...
3
33838
by: newbie1 | last post by:
Dear All, I am new to python. I need to write ctrl-z to a serial port to signal the end of input. This is required by the message format. I use: ser =...
4
2507
by: BlackMustard | last post by:
hello, i have a userform in a vba macro which contains three text boxes. sometimes i want to fill in only the first one, and other times one or two of the other as well. when i today want to leave...
0
7083
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...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.