//********************************************************* // /// <summary> /// Checks or unchecks all items in a checked list control /// </summary> /// <param name="checkedListBox"> Control</param> /// <param name="bChecked"> true to check, false to uncheck</param> // //********************************************************* private void CheckAllItems(CheckedListBox checkedListBox, bool bChecked) { int iCount; checkedListBox.SuspendLayout(); iCount = checkedListBox.Items.Count; for (int iIndex = 0; iIndex < iCount; iIndex++) { checkedListBox.SetItemChecked(iIndex, bChecked); } checkedListBox.ResumeLayout(); }