508 references to CheckState
Accessibility_Core_App (11)
CommonControl1.Designer.cs (1)
292this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
ContainerControls.Designer.cs (1)
339this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked;
ContainerControls2.Designer.cs (1)
190this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked;
Menu_Toolbars_controls.Designer.cs (8)
374checkCheckOnClickToolStripMenuItem.CheckState = CheckState.Checked; 382checkedCheckOnClickFToolStripMenuItem.CheckState = CheckState.Checked; 391indeterminateToolStripMenuItem.CheckState = CheckState.Indeterminate; 399indeterminateCheckOnClickFToolStripMenuItem.CheckState = CheckState.Indeterminate; 548toolStripButton3.CheckState = CheckState.Checked; 559toolStripButton4.CheckState = CheckState.Checked; 571toolStripButton5.CheckState = CheckState.Indeterminate; 582toolStripButton6.CheckState = CheckState.Indeterminate;
DesignSurface (2)
MainForm.cs (2)
147checkbox2.CheckState = CheckState.Indeterminate; 150checkbox3.CheckState = CheckState.Checked;
PresentationUI (1)
MS\Internal\Documents\SigningDialog.Designer.cs (1)
120_addDocPropCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
System.Windows.Forms (273)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (6)
36PaintDown(e, CheckState.Unchecked); 40PaintOver(e, CheckState.Unchecked); 44PaintUp(e, CheckState.Unchecked); 62internal abstract void PaintUp(PaintEventArgs e, CheckState state); 64internal abstract void PaintDown(PaintEventArgs e, CheckState state); 66internal abstract void PaintOver(PaintEventArgs e, CheckState state);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (25)
21internal override void PaintUp(PaintEventArgs e, CheckState state) 28|| (SystemInformation.HighContrast ? state != CheckState.Indeterminate : state == CheckState.Unchecked), 29check: !hasCustomBorder && SystemInformation.HighContrast && state == CheckState.Checked, 46case CheckState.Checked: 49case CheckState.Indeterminate: 58case CheckState.Checked: 61case CheckState.Indeterminate: 99else if (state == CheckState.Checked && SystemInformation.HighContrast) 104else if (state == CheckState.Indeterminate) 114internal override void PaintDown(PaintEventArgs e, CheckState state) 121|| (SystemInformation.HighContrast ? state != CheckState.Indeterminate : state == CheckState.Unchecked), 122!hasCustomBorder && SystemInformation.HighContrast && state == CheckState.Checked, 143case CheckState.Unchecked: 144case CheckState.Checked: 147case CheckState.Indeterminate: 187else if (state == CheckState.Checked && SystemInformation.HighContrast) 192else if (state == CheckState.Indeterminate) 202internal override void PaintOver(PaintEventArgs e, CheckState state) 214up: !Control.FlatAppearance.CheckedBackColor.IsEmpty || state == CheckState.Unchecked, 233backColor = state is CheckState.Checked or CheckState.Indeterminate 239backColor = state is CheckState.Indeterminate 281else if (state == CheckState.Unchecked)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (9)
13internal override void PaintUp(PaintEventArgs e, CheckState state) 16LayoutData layout = PaintPopupLayout(state == CheckState.Unchecked, 1).Layout(); 20if (state == CheckState.Indeterminate) 40state != CheckState.Indeterminate && IsHighContrastHighlighted() ? SystemColors.HighlightText : colors.WindowText, 49if (state == CheckState.Unchecked) 59internal override void PaintOver(PaintEventArgs e, CheckState state) 62LayoutData layout = PaintPopupLayout(state == CheckState.Unchecked, SystemInformation.HighContrast ? 2 : 1).Layout(); 66if (state == CheckState.Indeterminate) 117internal override void PaintDown(PaintEventArgs e, CheckState state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (6)
40internal override void PaintUp(PaintEventArgs e, CheckState state) => PaintWorker(e, up: true, state); 42internal override void PaintDown(PaintEventArgs e, CheckState state) => PaintWorker(e, up: false, state); 44internal override void PaintOver(PaintEventArgs e, CheckState state) => PaintUp(e, state); 106private void PaintWorker(PaintEventArgs e, bool up, CheckState state) 108up = up && state == CheckState.Unchecked; 130if (state == CheckState.Indeterminate)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (10)
62if (Control.CheckState == CheckState.Indeterminate) 84CheckState controlCheckState, 98else if (controlCheckState == CheckState.Indeterminate && checkBackground == SystemColors.Window && disabledColors) 126if (Control.CheckState == CheckState.Indeterminate) 151CheckState controlCheckState, 166else if (controlCheckState == CheckState.Indeterminate) 184if (controlCheckState == CheckState.Checked) 191controlCheckState == CheckState.Indeterminate, 236if (Control.CheckState == CheckState.Unchecked) 262if (Control.CheckState == CheckState.Indeterminate)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxFlatAdapter.cs (3)
12internal override void PaintDown(PaintEventArgs e, CheckState state) 31internal override void PaintOver(PaintEventArgs e, CheckState state) 50internal override void PaintUp(PaintEventArgs e, CheckState state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (3)
15internal override void PaintUp(PaintEventArgs e, CheckState state) 50internal override void PaintOver(PaintEventArgs e, CheckState state) 93internal override void PaintDown(PaintEventArgs e, CheckState state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (3)
15internal override void PaintUp(PaintEventArgs e, CheckState state) 64internal override void PaintDown(PaintEventArgs e, CheckState state) 76internal override void PaintOver(PaintEventArgs e, CheckState state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonFlatAdapter.cs (9)
12internal override void PaintDown(PaintEventArgs e, CheckState state) 17adapter.PaintDown(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); 32internal override void PaintOver(PaintEventArgs e, CheckState state) 37adapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); 52internal override void PaintUp(PaintEventArgs e, CheckState state) 57adapter.PaintUp(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonPopupAdapter.cs (9)
10internal override void PaintUp(PaintEventArgs e, CheckState state) 15adapter.PaintUp(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); 39internal override void PaintOver(PaintEventArgs e, CheckState state) 44adapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); 64internal override void PaintDown(PaintEventArgs e, CheckState state) 69adapter.PaintDown(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonStandardAdapter.cs (9)
10internal override void PaintUp(PaintEventArgs e, CheckState state) 14ButtonAdapter.PaintUp(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); 29internal override void PaintDown(PaintEventArgs e, CheckState state) 33ButtonAdapter.PaintDown(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); 41internal override void PaintOver(PaintEventArgs e, CheckState state) 45ButtonAdapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked);
System\Windows\Forms\Controls\Buttons\CheckBox.CheckBoxAccessibleObject.cs (9)
27CheckState.Checked => AccessibleStates.Checked | base.State, 28CheckState.Indeterminate => AccessibleStates.Indeterminate | base.State, 35CheckState.Checked => ToggleState.ToggleState_On, 36CheckState.Unchecked => ToggleState.ToggleState_Off, 83CheckState.Unchecked => CheckState.Checked, 84CheckState.Checked => CheckState.Indeterminate, 85_ => CheckState.Unchecked
System\Windows\Forms\Controls\Buttons\CheckBox.cs (12)
29private CheckState _checkState; 151get => _checkState != CheckState.Unchecked; 156CheckState = value ? CheckState.Checked : CheckState.Unchecked; 166[DefaultValue(CheckState.Unchecked)] 169public CheckState CheckState 439case CheckState.Unchecked: 440CheckState = CheckState.Checked; 442case CheckState.Checked: 445CheckState = CheckState.Indeterminate; 456CheckState = CheckState.Unchecked; 461CheckState = CheckState.Unchecked;
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (2)
913if (type.Equals(typeof(bool)) || type.Equals(typeof(CheckState))) 915dataGridViewColumn = new DataGridViewCheckBoxColumn(type.Equals(typeof(CheckState)));
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (61)
35private static readonly Type s_defaultCheckStateType = typeof(CheckState); 69if (value is CheckState valueAsCheckState) 71if (valueAsCheckState == CheckState.Checked) 76else if (valueAsCheckState == CheckState.Indeterminate) 139return CheckState.Checked; 148return CheckState.Indeterminate; 157return CheckState.Unchecked; 329private CheckState CheckState 337if ((!EditingCellValueChanged && FormattedValue is CheckState checkState && checkState == CheckState.Indeterminate) || 340return CheckState.Indeterminate; 343if ((!EditingCellValueChanged && FormattedValue is CheckState checkState2 && checkState2 == CheckState.Checked) || 346return CheckState.Checked; 352return CheckState.Checked; 355return CheckState.Unchecked; 564value = (CheckState)intValue switch 566CheckState.Checked => CheckState.Checked, 567CheckState.Unchecked => CheckState.Unchecked, 568CheckState.Indeterminate => CheckState.Indeterminate, 581value = CheckState.Checked; 585value = CheckState.Unchecked; 589value = CheckState.Indeterminate; 614else if (ret is CheckState retCheckState) 616if (retCheckState == CheckState.Checked) 620else if (retCheckState == CheckState.Unchecked) 626Debug.Assert(retCheckState == CheckState.Indeterminate); 957CheckState.Checked => string.Format(SR.DataGridViewCheckBoxCellCheckedStateDescription, cellName), 958CheckState.Unchecked => string.Format(SR.DataGridViewCheckBoxCellUncheckedStateDescription, cellName), 1069CheckState checkState; 1079if (formattedValue is not null and CheckState state) 1082bs = (checkState == CheckState.Unchecked) ? ButtonState.Normal : ButtonState.Checked; 1083drawAsMixedCheckBox = (checkState == CheckState.Indeterminate); 1089checkState = CheckState.Checked; 1094checkState = CheckState.Unchecked; 1102checkState = CheckState.Unchecked; 1323if (checkState == CheckState.Indeterminate) 1334if (checkState != CheckState.Unchecked) 1372checkState == CheckState.Indeterminate 1424checkState is CheckState.Checked or CheckState.Indeterminate, 1474checkState is CheckState.Checked or CheckState.Indeterminate, 1521checkState is CheckState.Checked or CheckState.Indeterminate, 1584return CheckState.Checked; 1599return CheckState.Unchecked; 1603else if (formattedValue is CheckState state) 1607case CheckState.Checked: 1618return CheckState.Checked; 1622case CheckState.Unchecked: 1633return CheckState.Unchecked; 1637case CheckState.Indeterminate: 1644return CheckState.Indeterminate; 1668if (FormattedValueType.IsAssignableFrom(typeof(CheckState))) 1672editingCell.EditingCellFormattedValue = CheckState.Indeterminate; 1676editingCell.EditingCellFormattedValue = CheckState.Unchecked; 1680editingCell.EditingCellFormattedValue = CheckState.Checked;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.DataGridViewCheckBoxCellAccessibleObject.cs (7)
35CheckState state => state switch 37CheckState.Checked => AccessibleStates.Checked | base.State, 38CheckState.Indeterminate => AccessibleStates.Indeterminate | base.State, 65case CheckState checkState: 66switchToCheckedState = checkState == CheckState.Unchecked; 160CheckState.Checked => ToggleState.ToggleState_On, 161CheckState.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (5)
23NullValue = threeState ? CheckState.Indeterminate : false 229DefaultCellStyle.NullValue = CheckState.Indeterminate; 231else if (!value && DefaultCellStyle.NullValue is CheckState state && state == CheckState.Indeterminate) 291defaultNullValue = templateCell.ThreeState ? CheckState.Indeterminate : false;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedItemCollection.cs (7)
149internal CheckState GetCheckedState(int index) 156return CheckState.Indeterminate; 160return CheckState.Checked; 163return CheckState.Unchecked; 174internal void SetCheckedState(int index, CheckState value) 181case CheckState.Checked: 186case CheckState.Indeterminate:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedListBoxItemAccessibleObject.cs (5)
84case CheckState.Checked: 87case CheckState.Indeterminate: 90case CheckState.Unchecked: 119case CheckState.Checked: 122case CheckState.Indeterminate:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (15)
370public CheckState GetItemCheckState(int index) 382public bool GetItemChecked(int index) => GetItemCheckState(index) != CheckState.Unchecked; 428CheckState currentValue = CheckedItems.GetCheckedState(index); 429CheckState newValue = (currentValue != CheckState.Unchecked) 430? CheckState.Unchecked 431: CheckState.Checked; 511case CheckState.Checked: 514case CheckState.Indeterminate: 835CheckState[] savedCheckedItems = new CheckState[Items.Count]; 855public void SetItemCheckState(int index, CheckState value) 862CheckState currentValue = CheckedItems.GetCheckedState(index); 883SetItemCheckState(index, value ? CheckState.Checked : CheckState.Unchecked);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.ObjectCollection.cs (3)
23return Add(item, isChecked ? CheckState.Checked : CheckState.Unchecked); 30public int Add(object item, CheckState check)
System\Windows\Forms\Controls\ListView\ListView.cs (8)
6535CheckState oldState = (CheckState)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uOldState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1); 6536CheckState newState = (CheckState)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uNewState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1); 6557CheckState oldValue = (CheckState)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uOldState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1); 6558CheckState newValue = (CheckState)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uNewState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (1)
66internal override void PaintUp(PaintEventArgs pevent, CheckState state)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (12)
13private CheckState _checkState = CheckState.Unchecked; 14private CheckState _prevCheckState = CheckState.Unchecked; 76get => _checkState != CheckState.Unchecked; 81CheckState = value ? CheckState.Checked : CheckState.Unchecked; 91[DefaultValue(CheckState.Unchecked)] 93public CheckState CheckState 98if (value is < CheckState.Unchecked or > CheckState.Indeterminate) 100throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(CheckState));
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.ToolStripButtonAccessibleObject.cs (5)
82internal void OnCheckStateChanged(CheckState oldValue, CheckState newValue) 90private static ToggleState CheckStateToToggleState(CheckState checkState) 93CheckState.Checked => ToggleState.ToggleState_On, 94CheckState.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (10)
255get => CheckState != CheckState.Unchecked; 260CheckState = value ? CheckState.Checked : CheckState.Unchecked; 272CheckState.Indeterminate => t_indeterminateCheckedImage ??= ScaleHelper.GetIconResourceAsBitmap( 276CheckState.Checked => t_checkedImage ??= ScaleHelper.GetIconResourceAsBitmap( 297[DefaultValue(CheckState.Unchecked)] 300public CheckState CheckState 302get => Properties.GetValueOrDefault(s_propCheckState, CheckState.Unchecked); 310Properties.AddOrRemoveValue(s_propCheckState, value, defaultValue: CheckState.Unchecked); 977if (CheckState != CheckState.Unchecked && menuItemInternalLayout.PaintCheck)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemAccessibleObject.cs (2)
144CheckState.Checked => ToggleState.ToggleState_On, 145CheckState.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (3)
349if (item is not null && item.CheckState == CheckState.Unchecked) 660else if (item is ToolStripMenuItem menuItem && menuItem.CheckState == CheckState.Checked) 749if (item is not null && item.CheckState != CheckState.Unchecked)
System\Windows\Forms\Internal\Formatter.cs (10)
16private static readonly Type s_checkStateType = typeof(CheckState); 115return CheckState.Indeterminate; 175return ((bool)value) ? CheckState.Checked : CheckState.Unchecked; 184? CheckState.Checked 185: CheckState.Unchecked; 318else if (value is CheckState state) 320if (state == CheckState.Indeterminate) 328return (state == CheckState.Checked); 335return targetConverter.ConvertFrom(context: null, GetFormatterCulture(formatInfo), state == CheckState.Checked);
System\Windows\Forms\ItemCheckEventArgs.cs (4)
11public ItemCheckEventArgs(int index, CheckState newCheckValue, CheckState currentValue) 26public CheckState NewValue { get; set; } 31public CheckState CurrentValue { get; }
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (2)
351_visibleCheckBox.CheckState = CheckState.Checked; 818if (type == typeof(bool) || type == typeof(CheckState))
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
643else if (propType == typeof(bool) || propType == typeof(CheckState))
System\Windows\Forms\Design\MaskDesignerDialog.cs (1)
207_checkBoxUseValidatingType.CheckState = CheckState.Checked;
System.Windows.Forms.Tests (192)
CheckedListBoxTests.cs (10)
360ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>(() => box.SetItemCheckState(index, CheckState.Checked)); 365[EnumData<CheckState>] 366public void CheckedListBox_SetItemCheckState_Invoke_GetReturnsExpected(CheckState value) 382[InvalidEnumData<CheckState>] 383public void CheckedListBox_SetItemCheckState_InvokeInvalidValue_ThrowsInvalidEnumArgumentException(CheckState value) 391[InlineData(true, CheckState.Checked)] 392[InlineData(false, CheckState.Unchecked)] 393public void CheckedListBox_SetItemChecked(bool send, CheckState expected) 746ItemCheckEventArgs eventArgs = new(0, CheckState.Checked, CheckState.Unchecked);
System\Windows\Forms\AccessibleObjects\CheckBox.CheckBoxAccessibleObjectTests.cs (24)
113[InlineData(true, CheckState.Checked, (int)ToggleState.ToggleState_On)] 114[InlineData(true, CheckState.Unchecked, (int)ToggleState.ToggleState_Off)] 115[InlineData(true, CheckState.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)] 116[InlineData(false, CheckState.Checked, (int)ToggleState.ToggleState_On)] 117[InlineData(false, CheckState.Unchecked, (int)ToggleState.ToggleState_Off)] 118[InlineData(false, CheckState.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)] 119public void CheckBoxAccessibleObject_ToggleState_ReturnsExpected(bool createControl, CheckState checkState, int toggleState) 136yield return new object[] { true, false, CheckState.Checked, (int)ToggleState.ToggleState_Off }; 137yield return new object[] { true, false, CheckState.Indeterminate, (int)ToggleState.ToggleState_Off }; 138yield return new object[] { true, false, CheckState.Unchecked, (int)ToggleState.ToggleState_On }; 140yield return new object[] { true, true, CheckState.Checked, (int)ToggleState.ToggleState_Indeterminate }; 141yield return new object[] { true, true, CheckState.Indeterminate, (int)ToggleState.ToggleState_Off }; 142yield return new object[] { true, true, CheckState.Unchecked, (int)ToggleState.ToggleState_On }; 144yield return new object[] { false, true, CheckState.Checked, (int)ToggleState.ToggleState_On }; 145yield return new object[] { false, true, CheckState.Indeterminate, (int)ToggleState.ToggleState_Indeterminate }; 146yield return new object[] { false, true, CheckState.Unchecked, (int)ToggleState.ToggleState_Off }; 148yield return new object[] { false, false, CheckState.Checked, (int)ToggleState.ToggleState_On }; 149yield return new object[] { false, false, CheckState.Indeterminate, (int)ToggleState.ToggleState_Indeterminate }; 150yield return new object[] { false, false, CheckState.Unchecked, (int)ToggleState.ToggleState_Off }; 155public void CheckBoxAccessibleObject_DoDefaultAction_Success(bool createControl, bool threeState, CheckState checkState, int toggleState) 263Assert.Equal(CheckState.Unchecked, checkBox.CheckState); 266Assert.Equal(CheckState.Checked, checkBox.CheckState); 270Assert.Equal(CheckState.Indeterminate, checkBox.CheckState); 274Assert.Equal(CheckState.Unchecked, checkBox.CheckState);
System\Windows\Forms\AccessibleObjects\CheckedListBoxItemAccessibleObjectTests.cs (7)
255[InlineData(true, CheckState.Checked, (int)ToggleState.ToggleState_On)] 256[InlineData(false, CheckState.Unchecked, (int)ToggleState.ToggleState_Off)] 257[InlineData(true, CheckState.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)] 258public void CheckedListBoxItemAccessibleObject_ToggleState_ReturnsExpected(bool checkValue, CheckState checkState, int toggleState) 348? (isChecked.Value ? CheckState.Checked : CheckState.Unchecked) 349: CheckState.Indeterminate);
System\Windows\Forms\AccessibleObjects\DataGridViewCheckBoxCellAccessibleObjectTests.cs (3)
279dataGridView.Rows.Add(CheckState.Indeterminate); 282dataGridView.Rows.Add(CheckState.Checked); 285dataGridView.Rows.Add(CheckState.Unchecked);
System\Windows\Forms\AccessibleObjects\ToolStripButton.ToolStripButtonAccessibleObjectTests.cs (11)
125[InlineData(true, CheckState.Checked, true)] 126[InlineData(true, CheckState.Unchecked, true)] 127[InlineData(true, CheckState.Indeterminate, true)] 128[InlineData(false, CheckState.Checked, true)] 129[InlineData(false, CheckState.Unchecked, false)] 130[InlineData(false, CheckState.Indeterminate, true)] 131public void ToolStripButtonAccessibleObject_IsTogglePatternSupported_ReturnsExpected(bool checkOnClick, CheckState checkState, bool expected) 158[InlineData(CheckState.Checked, (int)ToggleState.ToggleState_On)] 159[InlineData(CheckState.Unchecked, (int)ToggleState.ToggleState_Off)] 160[InlineData(CheckState.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)] 161public void ToolStripButtonAccessibleObject_ToggleState_ReturnsExpected(CheckState checkState, int expectedToggleState)
System\Windows\Forms\AccessibleObjects\ToolStripMenuItem.ToolStripMenuItemAccessibleObjectTests.cs (11)
198[InlineData(true, CheckState.Checked, true)] 199[InlineData(true, CheckState.Unchecked, true)] 200[InlineData(true, CheckState.Indeterminate, true)] 201[InlineData(false, CheckState.Checked, true)] 202[InlineData(false, CheckState.Unchecked, false)] 203[InlineData(false, CheckState.Indeterminate, true)] 204public void ToolStripMenuItemAccessibleObject_IsTogglePatternSupported_ReturnsExpected(bool checkOnClick, CheckState checkState, bool expected) 218[InlineData(CheckState.Checked, (int)ToggleState.ToggleState_On)] 219[InlineData(CheckState.Unchecked, (int)ToggleState.ToggleState_Off)] 220[InlineData(CheckState.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)] 221public void ToolStripMenuItemAccessibleObject_ToggleState_ReturnsExpected(CheckState checkState, int expectedToggleState)
System\Windows\Forms\CheckBoxTests.cs (33)
44Assert.Equal(CheckState.Unchecked, control.CheckState); 209[InlineData(true, CheckState.Checked)] 210[InlineData(false, CheckState.Unchecked)] 211public void CheckBox_CheckedGetSet(bool sent, CheckState expected) 222[InlineData(true, CheckState.Checked, true, CheckState.Indeterminate)] 223[InlineData(true, CheckState.Unchecked, true, CheckState.Checked)] 224[InlineData(true, CheckState.Indeterminate, false, CheckState.Unchecked)] 225[InlineData(false, CheckState.Checked, false, CheckState.Unchecked)] 226[InlineData(false, CheckState.Unchecked, true, CheckState.Checked)] 227[InlineData(false, CheckState.Indeterminate, false, CheckState.Unchecked)] 228public void CheckBox_OnClick_AutoCheck_SetCorrectCheckState(bool threeState, CheckState checkState, bool expectedChecked, CheckState expectedCheckState) 244[InlineData(true, CheckState.Checked, true)] 245[InlineData(true, CheckState.Unchecked, false)] 246[InlineData(true, CheckState.Indeterminate, true)] 247[InlineData(false, CheckState.Checked, true)] 248[InlineData(false, CheckState.Unchecked, false)] 249[InlineData(false, CheckState.Indeterminate, true)] 250public void CheckBox_OnClick_AutoCheckFalse_DoesNotChangeCheckState(bool threeState, CheckState expectedCheckState, bool expectedChecked) 266[EnumData<CheckState>] 267public void CheckBox_CheckState_Set_GetReturnsExpected(CheckState value) 283[InvalidEnumData<CheckState>] 284public void CheckBox_CheckState_SetInvalidValue_ThrowsInvalidEnumArgumentException(CheckState value) 769checkBox.CheckState = checkBox.CheckState == CheckState.Checked ? CheckState.Unchecked : CheckState.Checked; 871checkBox.CheckState.Should().Be(CheckState.Checked);
System\Windows\Forms\DataGridViewCellTests.cs (22)
6132yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Indeterminate, new DataGridViewCellStyle(), null, null, DBNull.Value }; 6133yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, null, true }; 6134yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Unchecked, new DataGridViewCellStyle(), null, null, false }; 6135yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Unchecked - 1, new DataGridViewCellStyle(), null, null, false }; 6136yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Indeterminate + 1, new DataGridViewCellStyle(), null, null, false }; 6137yield return new object[] { typeof(CheckState), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, null, CheckState.Checked }; 6138yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, null, 1 }; 6139yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), new EnumConverter(typeof(CheckState)), null, 1 }; 6140yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, new EnumConverter(typeof(CheckState)), 1 };
System\Windows\Forms\ToolStripButtonTests.cs (66)
38Assert.Equal(CheckState.Unchecked, item.CheckState); 119Assert.Equal(CheckState.Unchecked, item.CheckState); 206Assert.Equal(CheckState.Unchecked, item.CheckState); 296Assert.Equal(CheckState.Unchecked, item.CheckState); 384Assert.Equal(CheckState.Unchecked, item.CheckState); 482Assert.Equal(CheckState.Unchecked, item.CheckState); 636[InlineData(true, CheckState.Checked, CheckState.Unchecked)] 637[InlineData(false, CheckState.Unchecked, CheckState.Checked)] 638public void ToolStripButton_Checked_Set_GetReturnsExpected(bool value, CheckState expectedCheckState1, CheckState expectedCheckState2) 659[InlineData(true, CheckState.Checked, CheckState.Unchecked)] 660[InlineData(false, CheckState.Unchecked, CheckState.Checked)] 661public void ToolStripButton_Checked_SetWithOwner_GetReturnsExpected(bool value, CheckState expectedCheckState1, CheckState expectedCheckState2) 687[InlineData(true, CheckState.Checked, CheckState.Unchecked)] 688[InlineData(false, CheckState.Unchecked, CheckState.Checked)] 689public void ToolStripButton_Checked_SetWithOwnerWithHandle_GetReturnsExpected(bool value, CheckState expectedCheckState1, CheckState expectedCheckState2) 732[InlineData(true, CheckState.Checked, CheckState.Unchecked)] 733[InlineData(false, CheckState.Unchecked, CheckState.Checked)] 734public void ToolStripButton_Checked_SetWithParent_GetReturnsExpected(bool value, CheckState expectedCheckState1, CheckState expectedCheckState2) 760[InlineData(true, 2, CheckState.Checked, CheckState.Unchecked)] 761[InlineData(false, 0, CheckState.Unchecked, CheckState.Checked)] 762public void ToolStripButton_Checked_SetWithParentWithHandle_GetReturnsExpected(bool value, int expectedInvalidatedCallCount, CheckState expectedCheckState1, CheckState expectedCheckState2) 862[EnumData<CheckState>] 863public void ToolStripButton_CheckState_Set_GetReturnsExpected(CheckState value) 870Assert.Equal(value != CheckState.Unchecked, item.Checked); 875Assert.Equal(value != CheckState.Unchecked, item.Checked); 879[EnumData<CheckState>] 880public void ToolStripButton_CheckState_SetWithOwner_GetReturnsExpected(CheckState value) 889Assert.Equal(value != CheckState.Unchecked, item.Checked); 895Assert.Equal(value != CheckState.Unchecked, item.Checked); 900[EnumData<CheckState>] 901public void ToolStripButton_CheckState_SetWithOwnerWithHandle_GetReturnsExpected(CheckState value) 918Assert.Equal(value != CheckState.Unchecked, item.Checked); 927Assert.Equal(value != CheckState.Unchecked, item.Checked); 939CheckState = CheckState.Checked 959item.CheckState = CheckState.Unchecked; 960Assert.Equal(CheckState.Unchecked, item.CheckState); 965item.CheckState = CheckState.Unchecked; 966Assert.Equal(CheckState.Unchecked, item.CheckState); 971item.CheckState = CheckState.Indeterminate; 972Assert.Equal(CheckState.Indeterminate, item.CheckState); 978item.CheckState = CheckState.Unchecked; 979Assert.Equal(CheckState.Unchecked, item.CheckState); 985item.CheckState = CheckState.Indeterminate; 986Assert.Equal(CheckState.Indeterminate, item.CheckState); 992[InvalidEnumData<CheckState>] 993public void ToolStripButton_CheckState_SetInvalidValue_ThrowsInvalidEnumArgumentException(CheckState value) 1039[InlineData(true, CheckState.Checked, AccessibleStates.Focusable | AccessibleStates.Checked)] 1040[InlineData(true, CheckState.Indeterminate, AccessibleStates.Focusable | AccessibleStates.Checked)] 1041[InlineData(false, CheckState.Checked, AccessibleStates.None)] 1042[InlineData(false, CheckState.Indeterminate, AccessibleStates.None)] 1043public void ToolStripButton_CreateAccessibilityInstance_InvokeChecked_ReturnsExpected(bool enabled, CheckState checkState, AccessibleStates expectedState)
System\Windows\Forms\ToolStripButtonTests.Rendering.cs (1)
98toolStripButton.CheckState = CheckState.Indeterminate;
System\Windows\Forms\ToolStripMenuItemTests.cs (4)
52Assert.Equal(CheckState.Unchecked, item.CheckState); 281CheckState = CheckState.Checked, 399item.CheckState = CheckState.Checked; 403item.CheckState = CheckState.Unchecked;
WinFormsControlsTest (25)
CustomComCtl32Button.cs (3)
26CheckState = CheckState.Unchecked, 37CheckState = CheckState.Checked, 81isPressed = checkbox.CheckState == CheckState.Checked;
MenuStripAndCheckedListBox.Designer.cs (4)
236this.checkedToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; 246this.checkedCheckOnClickToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; 255this.indeterminateToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Indeterminate; 265this.indeterminateCheckOnClickToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Indeterminate;
MultipleControls.cs (1)
132checkedListBox1.Items.Add("Pennsylvania", CheckState.Checked);
MultipleControls.Designer.cs (4)
236this.checkedListBox1.SetItemCheckState(0, CheckState.Checked); 237this.checkedListBox1.SetItemCheckState(1, CheckState.Indeterminate); 294this.checkedListBox2.SetItemCheckState(0, CheckState.Checked); 295this.checkedListBox2.SetItemCheckState(1, CheckState.Indeterminate);
ToolStripTests.Designer.cs (13)
162this.toolStrip2_Button1.CheckState = System.Windows.Forms.CheckState.Unchecked; 170this.toolStrip2_Button2.CheckState = System.Windows.Forms.CheckState.Checked; 179this.toolStrip2_Button3.CheckState = System.Windows.Forms.CheckState.Indeterminate; 188this.toolStrip2_Button4.CheckState = System.Windows.Forms.CheckState.Unchecked; 222this.toolStrip3_MenuItem1.CheckState = System.Windows.Forms.CheckState.Checked; 247this.checkCheckOnClickToolStripMenuItem.CheckState = CheckState.Checked; 259this.thirdLevelItem.CheckState = System.Windows.Forms.CheckState.Checked; 267this.thirdLevelButton.CheckState = System.Windows.Forms.CheckState.Checked; 299this.toolStripMenuItem1.CheckState = System.Windows.Forms.CheckState.Checked; 316this.toolStripMenuItem2.CheckState = System.Windows.Forms.CheckState.Checked; 321this.checkedCheckOnClickFToolStripMenuItem.CheckState = CheckState.Checked; 330this.indeterminateToolStripMenuItem.CheckState = CheckState.Indeterminate; 338this.indeterminateCheckOnClickFToolStripMenuItem.CheckState = CheckState.Indeterminate;