Results 1 to 5 of 5

Thread: Buttons

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Unhappy 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.

  2. #2
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    no pic there

  3. #3
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

  4. #4

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    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:
    1. Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    2.     Toolbar1.Buttons(1).ButtonMenus.Item(1).Text = WebBrowser1.LocationName
    3.     Toolbar1.Buttons(1).ButtonMenus.Item(1).Key = WebBrowser1.LocationURL
    4. End Sub

    What is the proper syntax to use in that ButtonMenuClick event?

  5. #5

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    ok i have a private type....and this is what i used...

    VB Code:
    1. Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    2.     site1.Title = Toolbar1.Buttons(1).ButtonMenus.Item(1).Text = WebBrowser1.LocationName
    3.     site1.URL = Toolbar1.Buttons(1).ButtonMenus.Item(1).Key = WebBrowser1.LocationURL
    4.     site2.Title = site1.Title
    5.     site2.URL = site1.URL
    6.     site3.Title = site2.Title
    7.     site3.URL = site2.URL
    8.     site4.Title = site3.Title
    9.     site4.URL = site3.URL
    10.     site5.Title = site4.Title
    11.     site5.URL = site4.URL
    12.     Toolbar1.Buttons(1).ButtonMenus.Item(2).Text = site2.Title
    13.     Toolbar1.Buttons(1).ButtonMenus.Item(2).Key = site2.URL
    14.     Toolbar1.Buttons(1).ButtonMenus.Item(3).Text = site3.Title
    15.     Toolbar1.Buttons(1).ButtonMenus.Item(3).Key = site3.URL
    16.     Toolbar1.Buttons(1).ButtonMenus.Item(4).Text = site4.Title
    17.     Toolbar1.Buttons(1).ButtonMenus.Item(4).Key = site4.URL
    18.     Toolbar1.Buttons(1).ButtonMenus.Item(5).Text = site5.Title
    19.     Toolbar1.Buttons(1).ButtonMenus.Item(5).Key = site5.URL
    20. 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
  •  



Click Here to Expand Forum to Full Width