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 Combobox problem-VBForums
Results 1 to 12 of 12

Thread: Web browser Combobox problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    92

    Web browser Combobox problem

    Hi. Im making a web browser, and i have the code that records all the visited sites in the combo box.
    vb Code:
    1. Private Sub wweb_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 = wweb.LocationName
    6. For i = 0 To Combo1.ListCount - 1
    7. If cboURL.List(i) = wweb.LocationURL Then
    8. bFound = True
    9. Exit For
    10. End If
    11. Next i
    12. mbDontNavigateNow = True
    13. If bFound Then
    14. cboURL.RemoveItem i
    15. End If
    16. cboURL.AddItem wweb.LocationURL, 0
    17. cboURL.ListIndex = 0
    18. mbDontNavigateNow = False
    19. End Sub

    but when i click on an address listed in the drop down menu (while program is running) nothing happens. so i have a list of sites visited, but i cant click on them to visit them again.

    any help plz?

    Thanks in advance!

    calumrulez

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Web browser Combobox problem

    Remove the "On Error Resume Next"

    Run the code, and see if you are getting an error.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    92

    Re: Web browser Combobox problem

    I removed it, and i get this error message:

    Run time error '424'
    Object required

  4. #4
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Web browser Combobox problem

    Ok.

    On what line?
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    92

    Re: Web browser Combobox problem

    i get it on this line

    vb Code:
    1. If cboURL.List(i) = wweb.LocationURL Then

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    92

    Re: Web browser Combobox problem

    any ideas yet anyone?

    thanks in advance guys!

  7. #7
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,252

    Re: Web browser Combobox problem

    For i = 0 To Combo1.ListCount - 1

    maybe that should be,

    For i = 0 To cboURL.ListCount - 1

    ?

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    92

    Re: Web browser Combobox problem

    Quote Originally Posted by Edgemeal
    For i = 0 To Combo1.ListCount - 1

    maybe that should be,

    For i = 0 To cboURL.ListCount - 1

    ?
    good find man!
    when i remove the "On Error Resume Next" bit, no error shows up!!

    but i still cant click on anything in the combo box! (cboURL)

    thanks in advance

  9. #9
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,252

    Re: Web browser Combobox problem

    Quote Originally Posted by calumrulez
    but i still cant click on anything in the combo box! (cboURL)
    Not sure what you mean by can't click, either the cbo box is disabled or you have the navigate code in the cbo change event instead of it's click event?

    This is the way I was testing your code,
    Code:
    Private Sub cboURL_Click()
        If mbDontNavigateNow = True Then Exit Sub
        wweb.Navigate cboURL.List(cboURL.ListIndex)
    End Sub

  10. #10
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Web browser Combobox problem

    are you not able to click on an item in the combo box or when you click on an item in the combo nothing happens...whats the actual problem...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  11. #11

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    92

    Re: Web browser Combobox problem

    Quote Originally Posted by ganeshmoorthy
    are you not able to click on an item in the combo box or when you click on an item in the combo nothing happens...whats the actual problem...
    oh sorry..
    I click on the address in the combo box, but the text at the top doesnt change...

    and this is the code i am using for my combo box (to navigate)

    vb Code:
    1. Private Sub cboURL_KeyDown(KeyCode As Integer, Shift As Integer)
    2. If KeyCode = vbKeyReturn Then
    3.     wweb.Navigate cboURL.Text
    4. 'When the Enter Key is pressed, the browser navigates to the text in the combo bar
    5.  End If
    6. End Sub

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    92

    Re: Web browser Combobox problem

    any help plz anyone?!

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