|
-
Nov 30th, 2001, 10:08 PM
#1
Thread Starter
Frenzied Member
Buttons
Well, if you've played around with toolbars (NOT coolbars) you've noticed that you can make buttons with menus..like this:
and i was wondering how would would make Webbrowser1 navigate when you click that menu.
Last edited by SomethinCool; Nov 30th, 2001 at 10:52 PM.
-
Nov 30th, 2001, 10:43 PM
#2
Frenzied Member
-
Nov 30th, 2001, 10:46 PM
#3
PowerPoster
Use the ButtonMenuClick event, which fires when you select one of the items from the menu. Or are you trying to add the most recent webpages to that menu? You will have to set 2 variables everytime you navigate to a new page, and put the URL in one of the variables, and the Site title in the other. Then set that menu's caption to the name of the site, and set the code to navigate to the URL when you click that button.

There is his image... he forgot to add the http:// in front of it so the forum thought it was hosting it on it's own servers.
-
Nov 30th, 2001, 10:58 PM
#4
Thread Starter
Frenzied Member
Motoxpro..i know i was gonna change it until i got distracted for 30 min. Sorry.
Midgetsbro - Yes i am trying to add the 5 most recent web pages to that button. This is the code i have to add them. I am not sure how to do the rest..but i have one going so far..
VB Code:
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Toolbar1.Buttons(1).ButtonMenus.Item(1).Text = WebBrowser1.LocationName
Toolbar1.Buttons(1).ButtonMenus.Item(1).Key = WebBrowser1.LocationURL
End Sub
What is the proper syntax to use in that ButtonMenuClick event?
-
Nov 30th, 2001, 11:03 PM
#5
Thread Starter
Frenzied Member
ok i have a private type....and this is what i used...
VB Code:
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
site1.Title = Toolbar1.Buttons(1).ButtonMenus.Item(1).Text = WebBrowser1.LocationName
site1.URL = Toolbar1.Buttons(1).ButtonMenus.Item(1).Key = WebBrowser1.LocationURL
site2.Title = site1.Title
site2.URL = site1.URL
site3.Title = site2.Title
site3.URL = site2.URL
site4.Title = site3.Title
site4.URL = site3.URL
site5.Title = site4.Title
site5.URL = site4.URL
Toolbar1.Buttons(1).ButtonMenus.Item(2).Text = site2.Title
Toolbar1.Buttons(1).ButtonMenus.Item(2).Key = site2.URL
Toolbar1.Buttons(1).ButtonMenus.Item(3).Text = site3.Title
Toolbar1.Buttons(1).ButtonMenus.Item(3).Key = site3.URL
Toolbar1.Buttons(1).ButtonMenus.Item(4).Text = site4.Title
Toolbar1.Buttons(1).ButtonMenus.Item(4).Key = site4.URL
Toolbar1.Buttons(1).ButtonMenus.Item(5).Text = site5.Title
Toolbar1.Buttons(1).ButtonMenus.Item(5).Key = site5.URL
End Sub
and when i stop navigating...the first menu title doesnt display and the rest say False...how can i fix this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|