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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GS

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

    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?


  • Martin Zugec

    #2
    Re: how do I capture the control enter sequence in keydown orkeypressed event?

    Ufff, could you be more specific?

    It should work fine:

    Public Sub ComboKeyDown(By Val sender As Object, ByVal e As
    System.Windows. Forms.KeyEventA rgs)
    If e.KeyCode = Keys.Insert Then
    ' Do something
    End If
    End Sub

    Comment

    • Chris Dunaway

      #3
      Re: how do I capture the control enter sequence in keydown orkeypressed event?

      On Feb 22, 7:00 pm, Martin Zugec <martin.zu...@g mail.comwrote:
      Ufff, could you be more specific?
      >
      It should work fine:
      >
      Public Sub ComboKeyDown(By Val sender As Object, ByVal e As
      System.Windows. Forms.KeyEventA rgs)
      If e.KeyCode = Keys.Insert Then
      ' Do something
      End If
      End Sub
      Or this:

      Private Sub ComboBox1_KeyDo wn(ByVal sender As Object, ByVal e As
      System.Windows. Forms.KeyEventA rgs) Handles ComboBox1.KeyDo wn
      If e.KeyCode = Keys.Enter AndAlso e.Modifiers = Keys.Control Then
      'do something
      End If
      End Sub

      Private Sub ComboBox1_KeyPr ess(ByVal sender As Object, ByVal e As
      System.Windows. Forms.KeyPressE ventArgs) Handles ComboBox1.KeyPr ess
      If (e.KeyChar = Microsoft.Visua lBasic.ChrW(Key s.Return) AndAlso
      Control.Modifie rKeys = Keys.Control) Then
      'do something
      End If
      End Sub

      Chris

      Comment

      Working...