Private Sub WebBrowser_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean) >> Select Case Command >> Case CSC_NAVIGATEBACK >> Back.Enabled = Enable && Back is a button class >> Case CSC_NAVIGATEFORWARD >> Forward.Enabled = Enable && Forward is a button class >> End Select >>End SubNo line continuations in VB.
Do Case Case command = 2 thisform.cmdBack.Enabled = enable Case command = 1 thisform.cmdfwd.Enabled = enable EndCaseWhere cmdBack and cmdFwd are your back and forward buttons. And assuming the event fires on navigation.