: I made a VB browser that connected to the interned, but I want it to have a back button, how do I do this? : : Thanks :
Add this code to the webbrowser event:
[code] Private Sub WebBrowser_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean) If Command = CSC_NAVIGATEFORWARD Then canGoForward = Enable ' Set Forward to true/false Toolbar2.Buttons.Item(3).Enabled = Enable ' Dis/Enable Forward Button on toolbar End If If Command = CSC_NAVIGATEBACK Then canGoBack = Enable ' Set Back to true/false Toolbar2.Buttons.Item(2).Enabled = Enable ' Dis/Enable Back Button on toolbar End If End Sub [/code]
Then to navigate forward and back, make the following call: [code]webBrowser.goBack[/code] or [code]webBrowser.goForward[/code]
Comments
:
: Thanks
:
Add this code to the webbrowser event:
[code]
Private Sub WebBrowser_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
If Command = CSC_NAVIGATEFORWARD Then
canGoForward = Enable ' Set Forward to true/false
Toolbar2.Buttons.Item(3).Enabled = Enable ' Dis/Enable Forward Button on toolbar
End If
If Command = CSC_NAVIGATEBACK Then
canGoBack = Enable ' Set Back to true/false
Toolbar2.Buttons.Item(2).Enabled = Enable ' Dis/Enable Back Button on toolbar
End If
End Sub
[/code]
Then to navigate forward and back, make the following call:
[code]webBrowser.goBack[/code]
or
[code]webBrowser.goForward[/code]