Results 1 to 9 of 9

Thread: Error in WebBrowser

  1. #1

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335

    Exclamation

    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 .
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    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
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335

    hey

    where do i put this code ? in my webbrwser1 code. or do i let it make its own little sub
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    WB = webbrowser

    put it in your webbrowser COmmandSTateChange event!


    (look at the Private Sub...etc)
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335
    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
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    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
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335

    Talking 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
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

  8. #8
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    what will it do?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  9. #9

    Thread Starter
    Frenzied Member JasonLpz's Avatar
    Join Date
    Mar 2001
    Location
    Brooklyn, NY
    Posts
    1,335
    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 ?
    - JayWare
    Live to love. Not to Hate

    Im to busy to have a site. But I got one and still working on it.

    http://dre3k.net/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width