判断ListView被选定项的数量要用什么方法啊!!!

解决方案 »

  1.   

    foreach 遍历children
    似乎没有直接的属性来表示一共选定了多少项
      

  2.   

    这个怎么就不行呢!!!!private void btnmodify_Click(object sender, EventArgs e)
            {
                if (listView1.SelectedItems.Count !=1)
                {
                    MessageBox.Show("请选择其中一项");
                }
                else
                {
                    PersonEdit p = new PersonEdit();
                    p.Show();
                   
                }
            }