Results 1 to 6 of 6

Thread: Error

  1. #1

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

    Unhappy Error

    I'm making a webbrowser just so everyone knows....ya know..the easy stuff, and i was wondering how you would make the forward button disabled when you cant go forward.

  2. #2
    Lively Member
    Join Date
    May 1999
    Location
    Orange County
    Posts
    68
    well you dont need to have thay prebuilt thing that they give you when building a browser, and you could create your own command buttons or even better is you own pictures that look good then when you can't go foward you just say:

    image.enabled = false

    or

    command1.enabled = true

    did this help?
    Windows XP Professional
    Microsoft Visual Basic 6.0 Professional

  3. #3
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    Keep a collection of urls. Add/Remove the URLs to the back collection/forward collection as someone moves around. If the Count for the forward collection is 0 then disable the button.
    -Excalibur

  4. #4

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    I think i understand the count thing....um...but..i'm too stupid to figure out how to put it into code. how would you put it together?

  5. #5
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    If you know how to use arrays, collections are pretty much the same thing. Though you may want to use arrays instead. Sorry, but at the moment, my mind is pretty much dead (close to bed time) I'll look into it tomorrow for some examples.
    -Excalibur

  6. #6
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    Here's a great link for the WebBrowser Control.
    For what you want to do, search for CommandStateChange

    http://www.vbcity.com/page.asp?f=boo...bweb&p=chapter

    Here's the code I'm talking about. I believe in this example CmdNavigate(0) is the "Back" button, and CmdNavigate(2) is the "Forward" button.
    VB Code:
    1. Private Sub WebBrowser1_CommandStateChange(ByVal Command As Long, _
    2.                                            ByVal Enable As Boolean)
    3.    If Command = 2 Then
    4.       CmdNavigate(0).Enabled = Enable
    5.    End If
    6.  
    7.    If Command = 1 Then
    8.       CmdNavigate(2).Enabled = Enable
    9.    End If
    10.  
    11. End Sub

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