Keys.Enter

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

    Keys.Enter

    what should i do to prevent enter key from work i do that in prive sub

    but i need cancel the event

    what is the code i need?

    Private Sub TextBox1_KeyDow n(ByVal sender As System.Object, ByVal e As
    System.Windows. Forms.KeyEventA rgs) Handles TextBox1.KeyDow n

    If e.KeyCode = Keys.Enter Then

    ' the code to canel enter from work what i need thank you

    End If

    End Sub


  • Stephany Young

    #2
    Re: Keys.Enter

    e.Cancel = True


    "a" <a@a.netwrote in message news:uEjfgho0IH A.1240@TK2MSFTN GP02.phx.gbl...
    what should i do to prevent enter key from work i do that in prive sub
    >
    but i need cancel the event
    >
    what is the code i need?
    >
    Private Sub TextBox1_KeyDow n(ByVal sender As System.Object, ByVal e As
    System.Windows. Forms.KeyEventA rgs) Handles TextBox1.KeyDow n
    >
    If e.KeyCode = Keys.Enter Then
    >
    ' the code to canel enter from work what i need thank you
    >
    End If
    >
    End Sub
    >
    >

    Comment

    • Cyril Gupta

      #3
      Re: Keys.Enter

      I think e should have an handled property. You just need to set it to
      true.

      See if it works.

      Cheers!
      Cyril Gupta

      Comment

      Working...