Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick If e.Button Is Me.GoBackButton Then Me.AxWebBrowser1.GoBack() ElseIf e.Button Is Me.GoForwardButton Then Me.AxWebBrowser1.GoForward() End If End Sub
Private Sub AxWebBrowser1_CommandStateChange(ByVal sender As System.Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_CommandStateChangeEvent) Handles AxWebBrowser1.CommandStateChange If e.command = SHDocVw.CommandStateChangeConstants.CSC_NAVIGATEBACK Then Me.GoBackButton.Enabled = e.enable ElseIf e.command = SHDocVw.CommandStateChangeConstants.CSC_NAVIGATEFORWARD Then Me.GoForwardButton.Enabled = e.enable End If End Sub