Results 1 to 2 of 2

Thread: Reading data from listbox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Location
    Slovakia
    Posts
    20

    Angry Reading data from listbox

    Hello,
    How I can to obtain data from Listbox ?
    I have a list box where I can to choose some item.
    How I can to put selected item into the variable ?
    Can You help me somedoby ?

  2. #2
    Addicted Member
    Join Date
    Dec 2001
    Posts
    158
    A listbox can either be setup (properties) as a single selection type only, or a multi-selection type.

    Assuming you only have 1 selection enabled, you need to scan the listbox items first to find out which one is selected:

    If Mylistbox.ListIndex <> - 1 Then
    For X = 0 To Mylistbox.ListCount - 1
    If Mylistbox.Selected(X) = True Then MyString= Mylistbox.List(X)
    Next X
    Else
    'Nothing in the list was selected......
    End If

    If the Listindex property is "-1", then nothing has been selected

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