列表框的选中项目 [英] Checked Item of ListBox

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

问题描述

亲爱的

我有一个带checkbox的ListView.一个按钮外.
我想在单击按钮后找到ListView控件中选中的项目.

Dear

i have one ListView with checkbox.outside one Button.
I want to find the items of ListView Control checked items after a button click.

推荐答案

好吧,我实际上无法在此处得到您想要实现的目标.莱姆(Leme)猜测,如果正确,则可以使用带有某些项的ListView控件,并且表单上还可以有一个按钮.当您单击按钮时,是否要显示ListView中的所有选中项?
如果我说对了,这里是一段粗略的代码...
尝试让莱姆知道它是否对您有用....

Ok I actually couldn''t get what exactly you want to achieve here. Leme guess, if am right you have a ListView control with some Items and you also have a button on the form. When you click the button, you want all the checked items in the ListView to be displayed?
If i''m right the here''s a rough piece of code...
try and leme know if it worked for you....

foreach (ListViewItem item in listView1.Items)
            {
                if (item.Checked)
                    MessageBox.Show(item.ToString() + " is checked");
            }



问候



Regards,


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

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