System.Windows.Forms.CheckedListBox.SetItemChecked C# (CSharp) Method

SetItemChecked() public method

public SetItemChecked ( int index, bool value ) : void
index int
value bool
return void
		public void SetItemChecked (int index, bool value)
		{
			SetItemCheckState (index, value ? CheckState.Checked : CheckState.Unchecked);
		}

Usage Example

Example #1
1
        /// <summary>
        /// Set all items in a CheckedListBox checked/unchecked
        /// </summary>
        /// <param name="_listBox">ListBox to perform operation on</param>
        /// <param name="_select">Selected?</param>
        private void CheckListBoxItems(CheckedListBox _listBox, bool _select) {
            if(_listBox.Items.Count == 0) {
                status.Text = _select ? "Nothing to select." : "Nothing to deselect.";
            }

            for(int i = 0 ; i < _listBox.Items.Count ; i++ ) {
                _listBox.SetItemChecked(i, _select);
            }
        }
All Usage Examples Of System.Windows.Forms.CheckedListBox::SetItemChecked