+ Reply to Thread
Results 1 to 2 of 2

getting selected listbox values

  1. #1
    x taol
    Guest

    getting selected listbox values



    i set multiselect property of listbox control to fmMultiSelectExtended.
    by the way, i want to get the selected list names.
    the following code...??

    for i = 0 to listbox1.listcount - 1
    if listbox1.list(listbox1.listindex).selected then
    msgbox listbox1.list(listbox1.listindex)
    endif
    next

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    Norman Jones
    Guest

    Re: getting selected listbox values

    Hi X Taol,

    Try:

    '=============>>
    Private Sub CommandButton1_Click()
    Dim i As Long

    For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) = True Then
    MsgBox ListBox1.List(i)
    End If
    Next i

    End Sub
    '<<=============

    ---
    Regards,
    Norman



    "x taol" <[email protected]> wrote in message
    news:[email protected]...
    >
    >
    > i set multiselect property of listbox control to fmMultiSelectExtended.
    > by the way, i want to get the selected list names.
    > the following code...??
    >
    > for i = 0 to listbox1.listcount - 1
    > if listbox1.list(listbox1.listindex).selected then
    > msgbox listbox1.list(listbox1.listindex)
    > endif
    > next
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1