-
I have having a problem with my web browser but i think it's a simple problem. I can do everthing in the browser but lets say i press back when there is no more to go back to it shows a error. ex2: i start it up and press forward it errors then closes. I know that there is a error handle but i have no clue how to use it or how it works. I am a begginer .
-
Try using this:
(Make sure you change the object names to your button names)
WB = Webbrowser1
Code:
Private Sub WB_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
On Error Resume Next
DoEvents
If Enable = True And Command = CSC_NAVIGATEBACK Then
cmdBack.Enabled = True
Elseif Enable = False And Command = CSC_NAVIGATEBACK Then
cmdBack.Enabled = False
End If
If Enable = True And Command = CSC_NAVIGATEFORWARD Then
cmdFwd.Enabled = True
Elseif Enable = False And Command = CSC_NAVIGATEFORWARD Then
cmdFwd.Enabled = False
End If
End Sub
and use lots of on error resume next - sometimes it causes error for no reason - Micro$oft even says this
-
hey
where do i put this code ? in my webbrwser1 code. or do i let it make its own little sub
-
WB = webbrowser
put it in your webbrowser COmmandSTateChange event!
(look at the Private Sub...etc)
-
I tried it and it dont work the blow is how it looks with out the code you said.
Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As _
Object, URL As Variant)
End sub
no tell me where should i add it cause i changed all the cmd to pic cause they arent buttons .and i have no clue what to do
-
in the code window....at the top...
there are 2 pulldowns
left is object...right is event
select the webbrowser in left -
then select CommandStateChange in the right...
:)
the code
Code:
Private Sub Webbrowser1_CommandStateChange(ByVal Command As Long, ByVal Enable As Boolean)
End Sub
should appear
-
thank you
thanks alot and sorry if i had a attitude. Thank you alot when im done would you like to test out my program
THANK YOU
-
-
Im not sure what i will put in it i might just make it browse and stuff with my favorites because i am jus learning this stuff and dont know alot of code yet.
Is there anything you would like to see in it ?