Results 1 to 2 of 2

Thread: WebBrowser Control - Navigation

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Posts
    1

    WebBrowser Control - Navigation

    Simple Question:

    I have just started using the WebBrowser control within VB5 and I do not have much documentation for it. I'm trying to determine whether it is possible to GoBack or GoForward in order to Disable the relevant navigation controls.

    *What attributes are available in order for me to check this?*

    I do not want to capture the error code on the navigation itself when a "previous" or "next" URL is not available.

    Cheers.

  2. #2
    Matthew Gates
    Guest
    Try this:


    Code:
    'Author: Sebastien Levesque 
    'Origin: http://www.planet-source-code.com
    'Purpose: enable / disable back & forward in a webbrowser control
    'Version: VB5+ 
    
    
    Private Sub WebBrowser1_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
        On Error Resume Next
    
    
        Select Case Command
            Case CSC_NAVIGATEFORWARD
    
    
            If Enable = True Then
                'Forward dispo
    
    
                ForwardEnable = True
                    RaiseEvent ForwardUpdate(True)
                Else
                    'Forward non dispo
    
    
                    ForwardEnable = False
                        RaiseEvent ForwardUpdate(False)
                    End If
                    'Pas de forward
                    Case CSC_NAVIGATEBACK
    
    
                    If Enable = True Then
                        BackEnable = True
                        RaiseEvent BackUpdate(True)
                        'Back dispo
                    Else
                        BackEnable = False
                        RaiseEvent BackUpdate(False)
                        'Back non dispo
                    End If
                End Select
            If Command = -1 Then Exit Sub
            'End If
        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