陈宝刚---享受生活,追逐梦想!
理想是心中的火焰,有追求的人才是幸福的人!

       //全选方法一
        private void SelectAll(ListBox ListBox)
        ...{
            for (int i = 0; i < ListBox.Items.Count; i++)
            ...{

                ListBox.SelectedIndex = i;
            }  
        }
        //全选方法一和全不选
        private void SelectAll(ListBox ListBox,bool b)
        ...{
            for (int i = 0; i < ListBox.Items.Count; i++)
            ...{

                ListBox.SetSelected(i, b);
            }
        }
        //反选
        private void unSelectAll(ListBox ListBox)
        ...{
            bool b;
            for (int i = 0; i < ListBox.Items.Count; i++)
            ...{

                b = !ListBox.GetSelected(i);
                ListBox.SetSelected(i, b);
            }
        }

文章出处:http://www.diybl.com/course/4_webprogram/asp.net/netjs/20071020/78398.html

posted on 2009-01-11 08:04  追梦人RUBY  阅读(1261)  评论(0编辑  收藏  举报