ListBox Item Value

F

Frank

How can I get the value property from the item collection
in a ListBox control. I know I can get the selected
value with listBox.SelectedValue, but how can I get the
value property of all the selected items?

I would like to loop through the list and look and the
values.

I wish something like listBox.Items.Value worked.

Any help would be great,
Frank
 
H

Herfried K. Wagner [MVP]

* "Frank said:
How can I get the value property from the item collection
in a ListBox control. I know I can get the selected
value with listBox.SelectedValue, but how can I get the
value property of all the selected items?

I would like to loop through the list and look and the
values.

I wish something like listBox.Items.Value worked.


\\\
((CustomItemType)this.ListBox1.Items).Value = 22
///
 
F

Frank

Wow! You're are awesome and I am stupid! But I'm now
happy and stupid.

Thanks,
Frank
-----Original Message-----
* "Frank said:
How can I get the value property from the item collection
in a ListBox control. I know I can get the selected
value with listBox.SelectedValue, but how can I get the
value property of all the selected items?

I would like to loop through the list and look and the
values.

I wish something like listBox.Items.Value worked.


\\\
((CustomItemType)this.ListBox1.Items).Value = 22
///
 

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