|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Enabled/Disabled Internet control using vb6.0 and .NET
You have to do the following things to update automatically the forward/backward button using internet control.
Step 1: Declare constant variables ====================== Private Const CSC_NAVIGATEFORWARD As Integer = 1 Private Const CSC_NAVIGATEBACK As Integer = 2 Step 2: Write code on the Web Browser Command State Change Event ============================================== For VB 6.0, write the following code: ======================= Private Sub WebBrowser_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean) ' e.command identifies the effected button Select Case Command Case CSC_NAVIGATEBACK 'Back button ' Enable OR Disable the Back button Mytoolbar.Buttons(1).Enabled = Enable Case CSC_NAVIGATEFORWARD 'Forward button ' Enable OR Disable the Forward button Mytoolbar.Buttons(2).Enabled = Enable End Select end Sub For VB.NET, write the following code: ======================= Private Sub WebBrowser_CommandStateChange(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_CommandStateChangeEve nt) Handles WebBrowser.CommandStateChange ' e.command identifies the effected button Select Case e.command Case CSC_NAVIGATEBACK 'Back button ' Enable OR Disable the Back button Mytoolbar.Buttons(2)..Enabled = e.enable Case CSC_NAVIGATEFORWARD 'Forward button ' Enable OR Disable the Forward button Mytoolbar.Buttons(2)..Enabled = e.enable End Select End Sub Note: You can use command button as well. Then, you need to change the code shows below: Button1.Enabled= enable (for VB6) Button1.Enabled= e.enable(for VB.NET) I hope this will solve your backward/forward button issues while using webBrowser control Benoyraj B |
![]() |
| Viewing: ASP Free Forums > Other > Development Articles > Enabled/Disabled Internet control using vb6.0 and .NET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|