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

问题描述

大家好...

我在listview中具有带复选框的listitems,并设置了checkbox = true设置属性复选框,当我运行该listview时,该时间显示了所有带checked的listitems,但现在我未选中某些listitems.当我取消选中某些选项时,我想显示该选中状态.在这种情况下,我们必须努力.

当再次运行该列表视图时,该时间还会显示未选中的项目..
怎么可能..
请让我知道..

hhi to all...

i have listitems in listview with checkboxes and set property checkboxes checked =true and when i run that listview that time shows all listitems with checked but now i unchecked some listitems. when i unchecked some lstitems i want to strore that check staus..how ? in which event we have to strore..

when again run that listview that time shows unchecked items also..
how is it possible ..
pls let me know..

推荐答案

private void listView1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            ListViewItem l = listView1.Items[e.Index];
            if (e.NewValue == CheckState.Checked)
            {
                MessageBox.Show(l.ToString() + "  is checked.");

            }
            else
            {
                MessageBox.Show(l.ToString() + "  is UNchecked.");
            }
        }


这篇关于如何检查列表视图的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 00:27