View Single Post
Old Feb 22nd, 2005, 10:17 AM   #3
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Quote:
A ListBox control displays a list of items from which the user can select one or more. If the number of items exceeds the number that can be displayed, a scroll bar is automatically added to the ListBox control.

If no item is selected, the ListIndex property value is -1. The first item in the list is ListIndex 0, and the value of the ListCount property is always one more than the largest ListIndex value.

To add or delete items in a ListBox control, use the AddItem or RemoveItem method. Set the List, ListCount, and ListIndex properties to enable a user to access items in the ListBox. Alternatively, you can add items to the list by using the List property at design time.
That's from the msdn libaray. And you said there was nothing on the web about list boxes :-)

Anyways, to do what you want (or at least what i think you want to do), you would use the Selected property of the Listbox and a loop of your choosing. He's some more info about the selected property.

Quote:
Returns or sets the selection status of an item in a FileListBox or ListBox control. This property is an array of Boolean values with the same number of items as the List property. Not available at design time.
So now i'll show you in code.

      for x=0 to (myListBox.ListCount - 1) Step 1
      		if (myListBox.Selected == true) then
 			'do something with the item, like put it an array for later 
 			'use, or you could even write it to the text file from here.
    		  end if
      Next x


anyways, if i read your post right, that sould be what you need. you could use a do while loop or any other loop you want, but i jus tplain like for loops :-)
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!

Last edited by Pizentios; Feb 22nd, 2005 at 10:20 AM.
Pizentios is offline   Reply With Quote