Can someone tell me how to reference the webbrowser object?
Thanks
Printable View
Can someone tell me how to reference the webbrowser object?
Thanks
Click Project > References... and make sure Microsoft Internet Controls is checked and click OK.
Here is a little code to get you started:
A list of stuff will come up as you type "ie."Code:Dim ie As New InternetExplorer
Private Sub Form_Load()
ie.Navigate "http://www.vb-world.net
ie.Visible = True
End Sub
You should know what to do from there.
Is this the samething as what Dim did in this posting? I am referring to the last one.
http://209.207.250.147/showthread.php?threadid=29273
Thanks
I didn't know that. This is not Dims. I did write the whole thing out myself to tell you how to do it. I didn't look to find how to do this, I knew it.
Sorry for the misunderstanding Matthew. I mean does your code do the samething as Dim. I did not mean you copy Dim's code.
Hi Shark.
The code that Matthew provided and D!m's code are two different things. Matthew should you how to reference the Internet Explorer object. D!m's code shows how to create your own webbrowser object (by adding a component to your project rather than a reference). Although the webbrowser object uses the functionality of IE, when you place the object on your form, you have to code the logic for it's operations. This isn't the case with Matthew's example, where you use the IE app itself.
All the best.
Can you show me how to reference it and get start it like Dim?
Shark,
In your VB project, go to Project, Components and select Microsoft Internet Controls (this is the webbrowser object). Draw the control on your form and that's your webbrowser! :) From there you can use D!m's example (webbrowser1.Navigate2 "www.vb-world.net"). For more info., click here
All the best.
Sorry for misunderstanding you.
Referencing a control and adding one to your form are two different things.Quote:
Can someone tell me how to reference the webbrowser object?
When you reference a control, you can open it externally without having it on your form.
If you add a control to your form, obviously, you have to use it on your form.
Here are the basics of the Webbrowser Control, if that's what your going for.
Hope that helps.Code:'Go to the previous webpage
WebBrowser1.GoBack
'Go to the present webpage
WebBrowser1.GoForward
'Go to the default IE home
WebBrowser1.GoHome
'Go to the default search page
WebBrowser1.GoSearch
'Refresh the current webpage
WebBrowser1.Refresh
'Navigate to a webpage
WebBrowser1.Navigate "www.vb-world.net"
You guys are great!
We have to help you because you might bite us if we don't! :p
How did Dim get the commands after Document.? There is no drop down for it.
WebBrowser1.Document.Forms(0).login.Value = "my login name"
WebBrowser1.Document.Forms(0).passwd.Value = "mypassword"
WebBrowser1.Document.Forms(0).enter.Click
Shark,
D!m probably learned the commands from MSDN or some other reference source. That's one of the weird things that I learned when using the webbrowser object with VB. Although the intellisense (the drop-down lists) didn't work, the commands worked anyway!
If you search for "webbrowser object" here on VB-World, I'm sure that you can find a lot of useful information.
All the best.
You won't get bite from this Great White.