Value of Item in ListBox

C

Carlo

Hi
How do I assign the value of a highlighted item in a listbox to a
variable.
I need the program to allow the user to highlight an entry in a
listbox (which is a value) and take the value of the item highlighted
and subtract it from a variable (shown in a textbox) which holds the
sum of all the items in the listbox.

Thanks
Carlob1
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Carlo) scripsit:
How do I assign the value of a highlighted item in a listbox to a
variable.
I need the program to allow the user to highlight an entry in a
listbox (which is a value) and take the value of the item highlighted
and subtract it from a variable (shown in a textbox) which holds the
sum of all the items in the listbox.

Do you store strings or custom objects in the listbox? Have a look at
the listbox's 'SelectedItem' property.
 
C

Carlo

* (e-mail address removed) (Carlo) scripsit:

Do you store strings or custom objects in the listbox? Have a look at
the listbox's 'SelectedItem' property.

Stored as strings
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top