Results 1 to 3 of 3

Thread: Webbrowser Component - Select multiple items in listbox?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2007
    Posts
    51

    Webbrowser Component - Select multiple items in listbox?

    I'm working with the webbrowser component. I have a listbox on a HTML-page.

    This is what the listbox HTML looks like:
    <select name="domains_to_add[]" id="domains_to_add" multiple="multiple" class="multi_domains" size="10">

    I would like to select multiple items in the listbox, any idea how I do it?

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Webbrowser Component - Select multiple items in listbox?

    In your _DocumentComplete event after you know for sure you have the correct page loaded then you simply select items in the listbox by their index value like this:
    Code:
      '
      '
    Private Sub WebBrowser1_DocumentComplete(..........)
       '
       '
     '
     ' nn = numeric value of the list item you want to select  
     '
     WebBrowser1.Document.All("name-of-listbox").Value = nn
       '
       '
       '
    End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2007
    Posts
    51

    Re: Webbrowser Component - Select multiple items in listbox?

    Very nice! Thank you.

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