Keys.Enter

A

a

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_KeyDown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown

If e.KeyCode = Keys.Enter Then

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

End If

End Sub
 
C

Cyril Gupta

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

See if it works.

Cheers!
Cyril Gupta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top