如何查找列表框中存储的项的索引值 [英] how to find the index value of the item stored in listbox

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

问题描述

hi


i想知道列表框中特定项目的索引



i使用它像这样的int index = listbox1.indexof(currentitem)

但它总是显示-1



任何人都知道如何让索引帮助我。

hi
i want to know the index of the particular item inside listbox

i used it like this int index = listbox1.indexof("currentitem")
but it always display -1

anyone have any idea about how to get the index help me.

推荐答案

我认为SelectedIndex属性会返回所选项目的索引
I think SelectedIndex property will return you the index of the selected Item


这篇关于如何查找列表框中存储的项的索引值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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