Need some help...

WorrGames

New member
Joined
Mar 14, 2005
Messages
1
Programming Experience
3-5
I have a question...

I am loading a list box from a txt file and I need to write data from one file to another when the different things in the listbox are selected.

The problem is, I can't assume I know what is being loaded into the listbox, and therefore, I need to be able to check which option is selected in the listbox when it is clicked without being about to use a direct case/if statement.

I think I have an idea on how to do it, but I don't know the syntax. Im assuming that when the option in the listbox is selected, it automatically returns some sort of value for the selected thing. But how can I get that value and use it in another procedure.

Sorry if you don't understand what im getting at, but anyone that does follow what im saying; any help would be great!

Thanks :)
 
Last edited by a moderator:

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
You mean something like this:

VB.NET:
select case listbox.selecteditem
	 case "a"
do something....
	 case "b"
Do something else....
end select

TPM
 
Top Bottom