获得值按索引列表框项目索引、项目、列表

2023-09-07 12:49:36 作者:待我发光闪瞎你

这一定很容易,但我坚持。 我使用X项目列表框。每个项目都有一个文本描述(出现在列表框),并将其值(数字)。 我希望能够得到一个项目的价值属性,使用该项目的索引号。

This must be very easy but I am stuck. I have a listBox with X Items. Each Item has a text description (Which appears in the listBox) and its value(numerical). I want to be able to get the value property of an item, using the index number of the item.

推荐答案

这将是

String MyStr = ListBox.items[5].ToString();