|
-
Jun 4th, 2001, 05:20 AM
#1
Thread Starter
New Member
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.
-
Jun 4th, 2001, 06:18 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|