|
-
Dec 30th, 2000, 07:47 AM
#1
Thread Starter
Hyperactive Member
Hi all,
Some queries regarding the back button in the web browser.
How does one disable only the back button of the web browser?
Is it possible to add an input button on the HTMl page and make its functionality equivalent to the back button?
Thanks in advance.
-
Dec 30th, 2000, 08:32 AM
#2
Frenzied Member
you can't disable the back button, but you can put
a button that do the same that the back button.
<input type="button" value="back" onClick="history.go(-1);">
<input type="button" value="forward" onClick="history.go(1);">
<input type="button" value="refresh" onClick="history.go(0);">
-
Dec 30th, 2000, 02:37 PM
#3
To do it in the WebBrowser Control:
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
|