|
-
May 17th, 2004, 03:56 AM
#1
Thread Starter
Junior Member
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 ?
-
May 17th, 2004, 06:02 AM
#2
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|