Key codes?

I made a simple webbrowser and I am very used to hitting enter after I type the URL in and mine wont Navigate when RETURN(ENTER) is struck...

vbKeycodeRETURN

Isnt working for me...

[184 byte] By [Alex2200] at [2007-12-25]
# 1

Hi,

You probably want to use the following in the keydown event of the textbox:

If e.KeyCode = Keys.Enter Then
'your code here
e.SuppressKeyPress =
True

That last line to suppress the key from going to the KeyPress event. If you rather add the code to the KeyPress event, you should use:

If e.KeyChar = ChrW(13) Then

JohanHiemstra at 2007-9-3 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...