tags:

views:

38

answers:

2

Hi there I expose my problem, but first I ask you one example otherwise you will understand why, In VB6 when surfing the site and google example I set the textbox the value "Test" and then click on commandbotton I just enter the source webbrowser1.document.all ("g"). value = "Test" WebBrowser1.document.all ("btnG"). Click**

I would do the same with the vb.Net but I can not, I'd be happy to accept your advice. Thanks in advance

A: 

I'm not sure if I understand exactly but this might do what you want:

WebBrowser1.Url = New Uri(String.Format("http://www.google.co.uk/#hl=en&q={0}", txtBox1.Text))
ho1
this is not what I tried, Another example I post a CommandButton and a web browser by clicking on the textbox CommandButton google should enter "test" textbox in google (search bar).In short I have to insert the word "Test" in the google search bar
Still don't understand the difference. If you have the `txtBox1` control in your form and the user enter the word "test" in there and the click the button that calls the code I wrote above it should open www.google.co.uk and automatically search for "test" and the word test does appear in the search box on the google page.
ho1
A: 

It probably ought to look similar to this:

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    WebBrowser1.Document.All("g").InnerText = "Test"
    WebBrowser1.Document.All("btnG").InvokeMember("Click")
  End Sub
Hans Passant
Very nice, thank you