//全选方法一
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);
}
}
//by 闫磊 Email:Landgis@126.com,yanleigis@21cn.com 2007.10.10