Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internet Address Bar 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello, I used to have the code for a web browser but I have lost it.
So could anyone tell me the code for when someone types in an web site address, the application goes to that address.

So in other words I wanna make my own web browser.

Thanks.

Matt
 
The easiest way to do that is to site a webbrowser control on your form. The webbrowser control will be available when you include the 'Microsoft Internet Controls' component in you vb project. After that your off to the races!

Josh
 
Sure, the webbrowser control makes this pretty easy... but it isn't necessary to perform the task referenced in the question. Add a text box to a form, paste the following code, run the project and press enter in the text box (or type a URL and press enter).
[tt]
Private 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
Const SW_SHOWNORMAL = 1

Private Sub Form_Load()
Text1.Text =
Code:
"[URL unfurl="true"]http://www.tek-tips.com"[/URL]
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ShellExecute Form1.hwnd, vbNullString, _
Text1.Text, vbNullString, _
"C:\", SW_SHOWNORMAL
End If
End Sub
[/tt]
I guess it doesn't matter how you get there. As long as you get there.
VCA.gif
 
Or try this:
Add a command button to the form and pasre this code:
Code:
Private Sub Command1_Click()
Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE [URL unfurl="true"]http://www.freejavascripts.f2s.com/"[/URL]
End Sub
My site: msn/email: matthiasdeschagt@hotmail.com
icq: 123118841
online
 
ALT255-
If you reread the question you'll notice that MCRicketts doesn't want to open Internet Explorer. He wants to be able to view web pages from within his application.

Josh
 
Thanks for you replys but as Josh said, I do want to open the page within my application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top