|
-
Feb 23rd, 2008, 05:51 PM
#1
Thread Starter
New Member
[2008] Press Enter
I am working on a web browser, when you enter the URL into the text box, you cannot press enter and it work, you have to click the go button. How would I make the enter button get the browser to navigate?
-
Feb 23rd, 2008, 05:57 PM
#2
Re: [2008] Press Enter
In the TextBox's KeyDown event you can check for the enter key and fire away!
Edit: Do'h, accidently said to use TextChange. Fixed (stole Atheist's suggestion).
Last edited by Kasracer; Feb 23rd, 2008 at 06:01 PM.
-
Feb 23rd, 2008, 05:57 PM
#3
Re: [2008] Press Enter
Handle the TextBox' KeyDown event and do this:
VB.Net Code:
If e.KeyCode = Keys.Enter Then
WebBrowser1.Navigate(TextBox1.Text)
End If
-
Feb 23rd, 2008, 06:01 PM
#4
Frenzied Member
Re: [2008] Press Enter
Or you can even set the form's Accept Button property to the Go button, so every time you press Enter, the Go buton will receive a click.
-
Feb 23rd, 2008, 06:06 PM
#5
Thread Starter
New Member
Re: [2008] Press Enter
 Originally Posted by Atheist
Handle the TextBox' KeyDown event and do this:
VB.Net Code:
If e.KeyCode = Keys.Enter Then
WebBrowser1.Navigate(TextBox1.Text)
End If
Can that piece of code just go anywhere?
-
Feb 23rd, 2008, 06:09 PM
#6
Re: [2008] Press Enter
 Originally Posted by hah3303
Can that piece of code just go anywhere?
No, it was intended for the TextBox' KeyDown event-handler.
-
Feb 23rd, 2008, 06:10 PM
#7
Thread Starter
New Member
Re: [2008] Press Enter
Okay, how do I get to that area?
-
Feb 23rd, 2008, 06:10 PM
#8
Thread Starter
New Member
Re: [2008] Press Enter
Nevermind, I found it.
Edit: Okay, great! Wow, I have learned a lot from this forum .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|