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

how do I capture the control enter sequence in keydown or keypressed event?

GS
I was trying to catch the control enter key sequence of a combo box in the
keydown event, but I failed to se anything like control enter, neither Did I
find in keypresssed event

I tried google but no luck

Do I have to go down to the level of capturing control keydown/press with
time and then when enter key is pressed check the time? or is there some
easier way?
Feb 23 '08 #1
2 2554
Ufff, could you be more specific?

It should work fine:

Public Sub ComboKeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Insert Then
' Do something
End If
End Sub
Feb 23 '08 #2
On Feb 22, 7:00 pm, Martin Zugec <martin.zu...@gmail.comwrote:
Ufff, could you be more specific?

It should work fine:

Public Sub ComboKeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Insert Then
' Do something
End If
End Sub
Or this:

Private Sub ComboBox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown
If e.KeyCode = Keys.Enter AndAlso e.Modifiers = Keys.Control Then
'do something
End If
End Sub

Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
If (e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) AndAlso
Control.ModifierKeys = Keys.Control) Then
'do something
End If
End Sub

Chris
Feb 25 '08 #3

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

Similar topics

7
by: (Pete Cresswell) | last post by:
I've got KeyDown coding and it fires when other keys are pressed, but when Enter is pressed, nothing. I'd like to support the (standard?) Windows behavior of executing DblClick processing when...
3
by: Keith Smith | last post by:
Is there an easy way to make the {Enter} key take the cursor to the next control without using a KeyDown event on each control?
3
by: Anders K. Jacobsen [DK] | last post by:
Hi I have a problem delegating a keydown event to a button control when inside a a DropDownList control. I have this Enter name: Select Birth year . When the cursor is in the textbox...
10
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? ...
7
by: Bob Achgill | last post by:
When I use the code for KeyPress to capture pressing a certain key for processing on a form with no Text Box it works. But when I try the same code on my application that has text boxes it does...
15
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...
2
by: bretth | last post by:
In a VB.Net Windows Forms application, I have a user control that handles mouse events. Another section of code programmatically adds a label to the control. I would like label to ignore all...
4
by: boopsboops | last post by:
Hi thescripts people, I hope I'm in the right forum for Visual Basic Dotnet (VS 2005). I am trying to make a custom control in which you can nudge a point around using the arrow keys. Actually,...
4
by: Tom P. | last post by:
You wouldn't think this would be as hard as it is but for some reason I can't find a way to translate any of the codes in the KeyDownEventArgs into the actual characters they represent. The best...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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?

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.