PDA

View Full Version : Need Urgent Help! VB Internet controls browser and it's URL.


mark1221
09-30-2004, 04:27 AM
Hey there!

I used the "Microsoft Internet Controls" component to put a mini browser on my program, now i have a text box on the program, and a button to "search".
I want the user to be able to type a search string in the text box and when they press the button they search for that, if you didn't get me, here is my code


Private Sub Command2_Click()
Dim search As String

Text1.Text = search

WebBrowser1.Navigate2 ("www.someurl.com/the-search-string/something")

End Sub


Okay, the search string is stored in the "search" variable, but how do i put it in he URL,
"www.someurl.com/search/something" Won't work cause it will be considered as a part of the actual URL, but i want the "search"
variable to be there...

example, if someone types "mark" in the searchbox, i want it to go to "www.someurl.com/mark/something", and so on...

Any help will be appreciated.

suprize
02-18-2005, 04:27 PM
I might not understand what your asking...but like this?

Private Sub Command2_Click()

Dim strSearch As String
strSearch = Text1.Text

WebBrowser1.Navigate2 ("www.someurl.com/" & strSearch & "/something")

End Sub

kumar
03-04-2005, 07:49 AM
You can use this code
Private Sub cmdSearch_Click()
If KeyAscii = 13 Then
web.Navigate "http://www.google.co.in/search?hl=en&q=" & Text1.Text & "+&meta="
End If
End Sub