Matthew again...and to think I kept looking for back when it was GoBack.
:D
Printable View
Matthew again...and to think I kept looking for back when it was GoBack.
:D
You could've looked in the Object Browser as well :).
I know..I clicked WebBrowser.Back and gave up...la tee da dumb dumb me. Besides, I wanted to give you a shot at answering another question. LOL
:D
Well, if you press the back button to much, you'll get an error. So you can use On Error Resume Next.
Or you can disable/enabled the back button with this code which will disable it if you get back to the very first page you visited, or enable it when you are not on the very first page.
Code: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
The code in this thread may be good as well, if the code above doesn't work.