获得值按索引列表框项目 [英] Get the value for a listbox item by index

查看:181
本文介绍了获得值按索引列表框项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一定很容易,但我坚持。 我使用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();

这篇关于获得值按索引列表框项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆