• 0

[VB6] WebBrowser Control Location


Question

I want to set the location my web browser control is at load, but I'm not sure how to do it. I've tried to put in the form load:

WebBrowser1.LocationURL = http://www.tim-rogers.co.uk

but it dosen't work. How can I do it?

Now I have worked out that I need to use WebBrowser1.Navigate, but what is the syntax? I tried to use it but I couldn't work it out :p

Edited by TimRogers
Link to comment
https://www.neowin.net/forum/topic/409844-vb6-webbrowser-control-location/
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I've been digging around for something similar for my project and found something. THough i have no idea how to make it myself, just know that it works :p

'open web browser
Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Public Sub RunBrowser(strURL As String, iWindowStyle As Integer, fH As Long)
	Dim lSuccess As Long
	'-- Shell to default browser
	lSuccess = ShellExecute(fH, "Open", strURL, 0&, 0&, iWindowStyle)
End Sub

put that into a module

and to call it you put

Call RunBrowser("insert link here without the "" ", 10, 1)

edit: Oh your using a control...scrap what i just wrote above then....

Edited by Jexel
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.