a6106a
asked on
How do I make the current URL appear in the titlebar
My app uses the IE Browser control to display websites. I need the current URL to appear in the title bar of the form. How can I do this?
go does this:
frmMain.caption = "My Web Browser is located at - " & WebBrowserControl.URL
Thats should work - i have personally never used to control so i dont know what your control is called - Replace 'WebBrowserControl' with the controls name and that should work.
frmMain.caption = "My Web Browser is located at - " & WebBrowserControl.URL
Thats should work - i have personally never used to control so i dont know what your control is called - Replace 'WebBrowserControl' with the controls name and that should work.
ASKER
Lexien: The Web Browser Object (the Globe) doesn't have the URL property:
Tuer: Please tell me how to insert your code. I'm not too proficient. I've tried it several places but can't make it work.
Tuer: Please tell me how to insert your code. I'm not too proficient. I've tried it several places but can't make it work.
a6106a,
This shoulddn't be that difficult...
1. Show the form that contains your web browser object.
2. Double-click the web-browser object on the form.
(You will see the form's code window.)
3. Above the code window are two listboxes. In the second listbox, choose 'NavigateComplete2'.
Now enter this code inside the xxxxx_NavigateComplete2 procedure:
Me.Caption = URL
/Ture
This shoulddn't be that difficult...
1. Show the form that contains your web browser object.
2. Double-click the web-browser object on the form.
(You will see the form's code window.)
3. Above the code window are two listboxes. In the second listbox, choose 'NavigateComplete2'.
Now enter this code inside the xxxxx_NavigateComplete2 procedure:
Me.Caption = URL
/Ture
Okay I will post two different Solutions.
1)Getting the Name of the web site on the title bar.
Create a: Form, WebBrowser Control
Size the form to the size you want, next draw the WebBrowser control to the size you want. Next double click on the form and past this code.
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.msn.com"
End Sub
Private Sub WebBrowser1_NavigateComple te2(ByVal pDisp As Object, URL As Variant)
Form1.Caption = WebBrowser1.LocationName
End Sub
This will open the MSN web site in your browser control, and display the Web Pages title as your Forms Caption.
2)Getting the Address of the web site on the title bar.
Create a: Form, WebBrowser Control
Size the form to the size you want, next draw the WebBrowser control to the size you want. Next double click on the form and past this code.
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.msn.com"
End Sub
Private Sub WebBrowser1_NavigateComple te2(ByVal pDisp As Object, URL As Variant)
Form1.Caption = WebBrowser1.LocationURL
End Sub
This will open the MSN web site in your browser control, and display the Web Pages address on your Forms Caption.
1)Getting the Name of the web site on the title bar.
Create a: Form, WebBrowser Control
Size the form to the size you want, next draw the WebBrowser control to the size you want. Next double click on the form and past this code.
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.msn.com"
End Sub
Private Sub WebBrowser1_NavigateComple
Form1.Caption = WebBrowser1.LocationName
End Sub
This will open the MSN web site in your browser control, and display the Web Pages title as your Forms Caption.
2)Getting the Address of the web site on the title bar.
Create a: Form, WebBrowser Control
Size the form to the size you want, next draw the WebBrowser control to the size you want. Next double click on the form and past this code.
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.msn.com"
End Sub
Private Sub WebBrowser1_NavigateComple
Form1.Caption = WebBrowser1.LocationURL
End Sub
This will open the MSN web site in your browser control, and display the Web Pages address on your Forms Caption.
k, sorry - like i said i've never used the WebBrowser control before.
merry xmas
;)
merry xmas
;)
ASKER
mazur: please answer. yours worked fine for me.
thank you to all for your help.
thank you to all for your help.
a6106a,
Didn't my suggestion work? Or perhaps I diddn't explain myself clearly enough?
/Ture
Didn't my suggestion work? Or perhaps I diddn't explain myself clearly enough?
/Ture
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm sorry I can't give points to everyone who helped here. Thanks again to you.
Private Sub WebBrowser1_NavigateComple
Me.Caption = URL
End Sub
Ture Magnusson
Karlstad, Sweden