查找列表视图的所选项目 [英] Finding the selected item of list view

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

问题描述

目前,我有其中有几个数据行的列表视图,我在C#.NET中的ContextMenuStrip。

I currently have a list view which has several rows of data and I have a contextmenustrip in C# .NET.

什么我有是问题,当您点击我想知道哪些行被选中的菜单条项。

What I am having problems with is when you click on the menu strip item I want to know which row has been selected.

推荐答案

要获取所选行作为sindre说,你这样做:

To get selected rows as sindre says you do like this:

foreach (ListViewItem item in lvFiles.SelectedItems)
{
....................................
}

lvFiles是ListView的。

lvFiles is the ListView.

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

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