当点击被勾选的checkedlistbox的某一行时,右边的属性button 的enable=true; 当选定的未勾选时,右边的属性button 的enable=false;
if (checkedListBox1.CheckedItems.IndexOf(checkedListBox1.Items[3])<0)试过了不行
int count = SSH2_CLB.CheckedItems.Count; for (int i = 0; i < count; i++) { bool isChecked = SSH2_CLB.GetItemChecked(i); if (SSH2_CLB.GetItemChecked(i) == true) {BT_Attribute.Enabled = true;}if (SSH2_CLB.GetItemChecked(i) == false) { BT_Attribute.Enabled = false;这样也不行
当点击 checklistbox 里面勾选的项时 右边的butoon会使能 当点击checklistbox里面未勾选的项时 右边的butoon enable=false
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (checkedListBox1.GetItemChecked(checkedListBox1.SelectedIndex))
button3.Enabled = true;
}