如何获得选择的项目编号列表视图 [英] how to get selected item number listview

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

问题描述

如何在列表视图中获取选定的项目索引号?????????????

how to get selected item index number in listview?????????????

推荐答案

您确实需要开始自己做研究.如果您想知道某个类具有什么属性,方法,事件等,我建议您进行谷歌搜索.这是ListView成员的页面:
ListView成员 [
You really need to start doing your own research. If you want to know what properties, methods, events, etc... that a class has, I would suggest doing a google search. Here is the page for the ListView Members:
ListView Members[^]

I suggest looking through that...maybe for a property that starts with Selected.


您也可以为此使用列表行前面的复选框.
将listview属性"CheckBoxes"设置为"True".

现在,您可以检查项目的状态,如下所示:
You can also use checkboxes in front of your listrows for this.
Set the listview property ''CheckBoxes'' to ''True''.

Now you can check the state of an item like so:
Dim v As Integer
   For v = 0 To ListView1.Items.Count - 1
      If ListView1.Items(v).Checked = True Then
         ''Do whatever you want to do
      End If
   Next v


selecteditems(i).count应该告诉您,如果允许多个选择,则已经选择了多少项,

否则仅将selecteditems(0).item用作一项.
selecteditems(i).count should tell you how many items have been selected if you allow multiple selects,

otherwise use selecteditems(0).item for just one item.


这篇关于如何获得选择的项目编号列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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