PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
web browser current page-VBForums
Results 1 to 20 of 20

Thread: web browser current page

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    web browser current page

    when i was creating a web browser for my college assignment i found a tutorial on this site to help and when i put in the code for the history it worked but it also showed the current page on the title bar (which i wanted it to do), but when you change to a different site it just added the next site address to the title bar.

    heres the code:

    VB Code:
    1. Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    2.     On Error Resume Next
    3.     Dim i As Integer
    4.     Dim bFound As Boolean
    5.     Me.Caption = WebBrowser1.LocationName
    6.     For i = 0 To Combo1.ListCount - 1
    7.         If Combo1.List(i) = WebBrowser1.LocationURL Then
    8.             bFound = True
    9.             Exit For
    10.         End If
    11.     Next i
    12.     mbDontNavigateNow = True
    13.     If bFound Then
    14.         Combo1.RemoveItem i
    15.     End If
    16.     Combo1.AddItem WebBrowser1.LocationURL, 0
    17.     Combo1.ListIndex = 0
    18.     mbDontNavigateNow = False
    19. End Sub


    many thanks for the help
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    i think the problem is:

    VB Code:
    1. Me.Caption = WebBrowser1.LocationName
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  3. #3
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    VB Code:
    1. Private Sub wbrowser_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    2. On Error Resume Next
    3.     Dim i As Integer
    4.     Dim bFound As Boolean
    5.     Me.Caption = wbrowser.LocationName
    6.     For i = 0 To cboaddress.ListCount - 1
    7.         If cboaddress.List(i) = wbrowser.LocationURL Then
    8.             bFound = True
    9.             Exit For
    10.         End If
    11.     Next i
    12.  
    13.     If bFound Then
    14.         cboaddress.RemoveItem i
    15.     End If
    16.     cboaddress.AddItem wbrowser.LocationURL, 0
    17.     cboaddress.ListIndex = 0
    18.    
    19. End Sub

    This should work perfectly

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    Quote Originally Posted by Hell-Lord
    VB Code:
    1. Private Sub wbrowser_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    2. On Error Resume Next
    3.     Dim i As Integer
    4.     Dim bFound As Boolean
    5.     Me.Caption = wbrowser.LocationName
    6.     For i = 0 To cboaddress.ListCount - 1
    7.         If cboaddress.List(i) = wbrowser.LocationURL Then
    8.             bFound = True
    9.             Exit For
    10.         End If
    11.     Next i
    12.  
    13.     If bFound Then
    14.         cboaddress.RemoveItem i
    15.     End If
    16.     cboaddress.AddItem wbrowser.LocationURL, 0
    17.     cboaddress.ListIndex = 0
    18.    
    19. End Sub

    This should work perfectly

    oh damn it sorry that code did work until i modified it, (someone shoot me lol), what i done was i wanted it to show the orginal caption which was "Web Browser" then i wanted it to show " - (web address)"

    sorry if u spent time on the wrong problem
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  5. #5
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    So you got it fixed though?

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    Quote Originally Posted by Hell-Lord
    So you got it fixed though?

    no thats what i needed help with i realli shud give my posts a check before i write them lol

    can u help?
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  7. #7
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    O and if you want it to show your form's caption then you can make it
    VB Code:
    1. me.caption = me.caption & " wbrowser.locationname"

  8. #8
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    kk show me the exact code that is highlighted when it errors.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    VB Code:
    1. Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    2.     On Error Resume Next
    3.     Dim i As Integer
    4.     Dim bFound As Boolean
    5.    
    6.     [B]Me.Caption = Me.Caption & "-" & WebBrowser1.LocationName[/B]  
    7.     For i = 0 To address.ListCount - 1
    8.         If address.List(i) = WebBrowser1.LocationURL Then
    9.             bFound = True
    10.             Exit For
    11.         End If
    12.     Next i
    13.    
    14.     If bFound Then
    15.         address.RemoveItem i
    16.     End If
    17.     address.AddItem WebBrowser1.LocationURL, 0
    18.     address.ListIndex = 0

    the part in bold is the prob, for example your on google 1st it will show google in the title bar after the "-" but then if u go to another page it shows the google and that page after google

    if you understand that
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  10. #10
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    It works fine and its doing what it is meant to add the URL to the combo box list.

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    Quote Originally Posted by Hell-Lord
    It works fine and its doing what it is meant to add the URL to the combo box list.
    i dont know if im explaining it wrong but i mean the title bar to the program not the web browser.

    eg. "Web Browser" when the form loads

    when an address is put in it shows "Web Browser - (website)"

    then when u put another address in it adds that aswell ... "Web Browser - (website) (website)"
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  12. #12
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    so you saying if you go to google then the me.caption will be Webbroswer - Google and then once you go to lets say yahoo it would be webbrowser - googleyahoo?

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    Quote Originally Posted by Hell-Lord
    so you saying if you go to google then the me.caption will be Webbroswer - Google and then once you go to lets say yahoo it would be webbrowser - googleyahoo?
    yes, can u help?
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  14. #14
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    o wait a moment what have you got under form load?

  15. #15

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    Quote Originally Posted by Hell-Lord
    o wait a moment what have you got under form load?
    nothing in form load.

    you must think im a real pain in the arse at the moment lol
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  16. #16
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    Nah i don't mind helping but anyway when you use the code i posted what happens?

  17. #17

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    Quote Originally Posted by Hell-Lord
    Nah i don't mind helping but anyway when you use the code i posted what happens?

    posted it where?

    im probly not lookin hard enugh
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  18. #18
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    Look At Post#3

  19. #19

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    england
    Posts
    27

    Re: web browser current page

    Quote Originally Posted by Hell-Lord
    Look At Post#3
    oh so i cant have it saying "Web Browser - google" otherwise it will keep on duplicating
    dont believe in all that you've been told!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  20. #20
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: web browser current page

    Is web browser - google your form's caption? If it is then you can't.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width