By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,890 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,890 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.