|
-
May 18th, 2001, 09:44 AM
#1
FileListBox
I have setup a filelistbox that allows multiple selections. How do I view each selection in the code (i.e. File1.FileName just shows me the last selection, I want all selected items. File1.Selected (#) just tells me if that number was selected.) I assume I could write a for loop that checks if each item was selected and stick the results in an array, but I figure there has to be an easier way.
Thanks,
Quad
-
May 18th, 2001, 10:35 AM
#2
Re: FileListBox
Isn't that easy enough? 
-
May 18th, 2001, 10:38 AM
#3
Re: FileListBox
If that is the only option, but I hate to do excess processing when it could be a property array of the component.
-
May 18th, 2001, 10:51 AM
#4
Re: FileListBox
From msdn:
Private Sub Form_Load ()
Dim I ' Declare variable.
' Fill the list box with screen font names.
For I = 0 To Screen.FontCount - 1
List1.AddItem Screen.Fonts(I)
Next I
End Sub
Private Sub Command1_Click ()
Dim I ' Declare variable.
' Clear all items from the list.
List2.Clear
' If an item is selected, add it to List2.
For I = 0 To List1.ListCount - 1
If List1.Selected(I) Then
List2.AddItem List1.List(I)
End If
Next I
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 18th, 2001, 11:57 AM
#5
Re: FileListBox
Nope, that is the easiest way and the only way 
-Cool Bizs
Good Luck,
-Cool Bizs
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
|