515 references to CheckState
DemoConsole (2)
MainForm.cs (2)
171
checkbox2.CheckState =
CheckState
.Indeterminate;
174
checkbox3.CheckState =
CheckState
.Checked;
PresentationUI (1)
MS\Internal\Documents\SigningDialog.Designer.cs (1)
120
_addDocPropCheckBox.CheckState = System.Windows.Forms.
CheckState
.Checked;
System.Windows.Forms (280)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (6)
37
PaintDown(e,
CheckState
.Unchecked);
41
PaintOver(e,
CheckState
.Unchecked);
45
PaintUp(e,
CheckState
.Unchecked);
64
internal abstract void PaintUp(PaintEventArgs e,
CheckState
state);
66
internal abstract void PaintDown(PaintEventArgs e,
CheckState
state);
68
internal abstract void PaintOver(PaintEventArgs e,
CheckState
state);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (25)
21
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
28
|| (SystemInformation.HighContrast ? state !=
CheckState
.Indeterminate : state ==
CheckState
.Unchecked),
29
check: !hasCustomBorder && SystemInformation.HighContrast && state ==
CheckState
.Checked,
46
case
CheckState
.Checked:
49
case
CheckState
.Indeterminate:
58
case
CheckState
.Checked:
61
case
CheckState
.Indeterminate:
99
else if (state ==
CheckState
.Checked && SystemInformation.HighContrast)
104
else if (state ==
CheckState
.Indeterminate)
114
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
121
|| (SystemInformation.HighContrast ? state !=
CheckState
.Indeterminate : state ==
CheckState
.Unchecked),
122
!hasCustomBorder && SystemInformation.HighContrast && state ==
CheckState
.Checked,
143
case
CheckState
.Unchecked:
144
case
CheckState
.Checked:
147
case
CheckState
.Indeterminate:
187
else if (state ==
CheckState
.Checked && SystemInformation.HighContrast)
192
else if (state ==
CheckState
.Indeterminate)
202
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
214
up: !Control.FlatAppearance.CheckedBackColor.IsEmpty || state ==
CheckState
.Unchecked,
229
? state is
CheckState
.Checked or
CheckState
.Indeterminate
232
: state is
CheckState
.Indeterminate
276
else if (state ==
CheckState
.Unchecked)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (9)
13
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
16
LayoutData layout = PaintPopupLayout(state ==
CheckState
.Unchecked, 1).Layout();
20
if (state ==
CheckState
.Indeterminate)
40
state !=
CheckState
.Indeterminate && IsHighContrastHighlighted() ? SystemColors.HighlightText : colors.WindowText,
49
if (state ==
CheckState
.Unchecked)
59
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
62
LayoutData layout = PaintPopupLayout(state ==
CheckState
.Unchecked, SystemInformation.HighContrast ? 2 : 1).Layout();
66
if (state ==
CheckState
.Indeterminate)
117
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (6)
40
internal override void PaintUp(PaintEventArgs e,
CheckState
state) => PaintWorker(e, up: true, state);
42
internal override void PaintDown(PaintEventArgs e,
CheckState
state) => PaintWorker(e, up: false, state);
44
internal override void PaintOver(PaintEventArgs e,
CheckState
state) => PaintUp(e, state);
106
private void PaintWorker(PaintEventArgs e, bool up,
CheckState
state)
108
up = up && state ==
CheckState
.Unchecked;
130
if (state ==
CheckState
.Indeterminate)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (10)
62
if (Control.CheckState ==
CheckState
.Indeterminate)
84
CheckState
controlCheckState,
98
else if (controlCheckState ==
CheckState
.Indeterminate && checkBackground == SystemColors.Window && disabledColors)
126
if (Control.CheckState ==
CheckState
.Indeterminate)
151
CheckState
controlCheckState,
166
else if (controlCheckState ==
CheckState
.Indeterminate)
184
if (controlCheckState ==
CheckState
.Checked)
191
controlCheckState ==
CheckState
.Indeterminate,
236
if (Control.CheckState ==
CheckState
.Unchecked)
262
if (Control.CheckState ==
CheckState
.Indeterminate)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxFlatAdapter.cs (3)
12
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
31
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
50
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (3)
15
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
50
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
93
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (3)
15
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
64
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
76
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\ButtonDarkModeAdapter.cs (7)
28
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
66
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
103
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
156
private static PushButtonState ToPushButtonState(
CheckState
state, bool enabled) =>
161
CheckState
.Unchecked => PushButtonState.Normal,
162
CheckState
.Checked => PushButtonState.Pressed,
163
CheckState
.Indeterminate => PushButtonState.Hot,
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonFlatAdapter.cs (9)
12
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
17
adapter.PaintDown(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
32
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
37
adapter.PaintOver(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
52
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
57
adapter.PaintUp(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonPopupAdapter.cs (9)
10
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
15
adapter.PaintUp(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
39
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
44
adapter.PaintOver(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
64
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
69
adapter.PaintDown(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonStandardAdapter.cs (9)
10
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
14
ButtonAdapter.PaintUp(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
29
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
33
ButtonAdapter.PaintDown(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
41
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
45
ButtonAdapter.PaintOver(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\Buttons\CheckBox.CheckBoxAccessibleObject.cs (9)
27
CheckState
.Checked => AccessibleStates.Checked | base.State,
28
CheckState
.Indeterminate => AccessibleStates.Indeterminate | base.State,
35
CheckState
.Checked => ToggleState.ToggleState_On,
36
CheckState
.Unchecked => ToggleState.ToggleState_Off,
83
CheckState
.Unchecked =>
CheckState
.Checked,
84
CheckState
.Checked =>
CheckState
.Indeterminate,
85
_ =>
CheckState
.Unchecked
System\Windows\Forms\Controls\Buttons\CheckBox.cs (12)
29
private
CheckState
_checkState;
174
get => _checkState !=
CheckState
.Unchecked;
179
CheckState = value ?
CheckState
.Checked :
CheckState
.Unchecked;
189
[DefaultValue(
CheckState
.Unchecked)]
192
public
CheckState
CheckState
461
case
CheckState
.Unchecked:
462
CheckState =
CheckState
.Checked;
464
case
CheckState
.Checked:
467
CheckState =
CheckState
.Indeterminate;
478
CheckState =
CheckState
.Unchecked;
483
CheckState =
CheckState
.Unchecked;
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (2)
913
if (type.Equals(typeof(bool)) || type.Equals(typeof(
CheckState
)))
915
dataGridViewColumn = new DataGridViewCheckBoxColumn(type.Equals(typeof(
CheckState
)));
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (61)
35
private static readonly Type s_defaultCheckStateType = typeof(
CheckState
);
69
if (value is
CheckState
valueAsCheckState)
71
if (valueAsCheckState ==
CheckState
.Checked)
76
else if (valueAsCheckState ==
CheckState
.Indeterminate)
139
return
CheckState
.Checked;
148
return
CheckState
.Indeterminate;
157
return
CheckState
.Unchecked;
329
private
CheckState
CheckState
337
if ((!EditingCellValueChanged && FormattedValue is
CheckState
checkState && checkState ==
CheckState
.Indeterminate) ||
340
return
CheckState
.Indeterminate;
343
if ((!EditingCellValueChanged && FormattedValue is
CheckState
checkState2 && checkState2 ==
CheckState
.Checked) ||
346
return
CheckState
.Checked;
352
return
CheckState
.Checked;
355
return
CheckState
.Unchecked;
564
value = (
CheckState
)intValue switch
566
CheckState
.Checked =>
CheckState
.Checked,
567
CheckState
.Unchecked =>
CheckState
.Unchecked,
568
CheckState
.Indeterminate =>
CheckState
.Indeterminate,
581
value =
CheckState
.Checked;
585
value =
CheckState
.Unchecked;
589
value =
CheckState
.Indeterminate;
614
else if (ret is
CheckState
retCheckState)
616
if (retCheckState ==
CheckState
.Checked)
620
else if (retCheckState ==
CheckState
.Unchecked)
626
Debug.Assert(retCheckState ==
CheckState
.Indeterminate);
957
CheckState
.Checked => string.Format(SR.DataGridViewCheckBoxCellCheckedStateDescription, cellName),
958
CheckState
.Unchecked => string.Format(SR.DataGridViewCheckBoxCellUncheckedStateDescription, cellName),
1077
CheckState
checkState;
1087
if (formattedValue is not null and
CheckState
state)
1090
bs = (checkState ==
CheckState
.Unchecked) ? ButtonState.Normal : ButtonState.Checked;
1091
drawAsMixedCheckBox = (checkState ==
CheckState
.Indeterminate);
1097
checkState =
CheckState
.Checked;
1102
checkState =
CheckState
.Unchecked;
1110
checkState =
CheckState
.Unchecked;
1331
if (checkState ==
CheckState
.Indeterminate)
1342
if (checkState !=
CheckState
.Unchecked)
1380
checkState ==
CheckState
.Indeterminate
1432
checkState is
CheckState
.Checked or
CheckState
.Indeterminate,
1482
checkState is
CheckState
.Checked or
CheckState
.Indeterminate,
1529
checkState is
CheckState
.Checked or
CheckState
.Indeterminate,
1592
return
CheckState
.Checked;
1607
return
CheckState
.Unchecked;
1611
else if (formattedValue is
CheckState
state)
1615
case
CheckState
.Checked:
1626
return
CheckState
.Checked;
1630
case
CheckState
.Unchecked:
1641
return
CheckState
.Unchecked;
1645
case
CheckState
.Indeterminate:
1652
return
CheckState
.Indeterminate;
1676
if (FormattedValueType.IsAssignableFrom(typeof(
CheckState
)))
1680
editingCell.EditingCellFormattedValue =
CheckState
.Indeterminate;
1684
editingCell.EditingCellFormattedValue =
CheckState
.Unchecked;
1688
editingCell.EditingCellFormattedValue =
CheckState
.Checked;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.DataGridViewCheckBoxCellAccessibleObject.cs (7)
35
CheckState
state => state switch
37
CheckState
.Checked => AccessibleStates.Checked | base.State,
38
CheckState
.Indeterminate => AccessibleStates.Indeterminate | base.State,
65
case
CheckState
checkState:
66
switchToCheckedState = checkState ==
CheckState
.Unchecked;
160
CheckState
.Checked => ToggleState.ToggleState_On,
161
CheckState
.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (5)
23
NullValue = threeState ?
CheckState
.Indeterminate : false
229
DefaultCellStyle.NullValue =
CheckState
.Indeterminate;
231
else if (!value && DefaultCellStyle.NullValue is
CheckState
state && state ==
CheckState
.Indeterminate)
291
defaultNullValue = templateCell.ThreeState ?
CheckState
.Indeterminate : false;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedItemCollection.cs (7)
149
internal
CheckState
GetCheckedState(int index)
156
return
CheckState
.Indeterminate;
160
return
CheckState
.Checked;
163
return
CheckState
.Unchecked;
174
internal void SetCheckedState(int index,
CheckState
value)
181
case
CheckState
.Checked:
186
case
CheckState
.Indeterminate:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedListBoxItemAccessibleObject.cs (5)
84
case
CheckState
.Checked:
87
case
CheckState
.Indeterminate:
90
case
CheckState
.Unchecked:
119
case
CheckState
.Checked:
122
case
CheckState
.Indeterminate:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (15)
370
public
CheckState
GetItemCheckState(int index)
382
public bool GetItemChecked(int index) => GetItemCheckState(index) !=
CheckState
.Unchecked;
428
CheckState
currentValue = CheckedItems.GetCheckedState(index);
429
CheckState
newValue = (currentValue !=
CheckState
.Unchecked)
430
?
CheckState
.Unchecked
431
:
CheckState
.Checked;
511
case
CheckState
.Checked:
514
case
CheckState
.Indeterminate:
835
CheckState
[] savedCheckedItems = new
CheckState
[Items.Count];
855
public void SetItemCheckState(int index,
CheckState
value)
862
CheckState
currentValue = CheckedItems.GetCheckedState(index);
883
SetItemCheckState(index, value ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.ObjectCollection.cs (3)
23
return Add(item, isChecked ?
CheckState
.Checked :
CheckState
.Unchecked);
30
public int Add(object item,
CheckState
check)
System\Windows\Forms\Controls\ListView\ListView.cs (8)
6609
CheckState
oldState = (
CheckState
)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uOldState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
6610
CheckState
newState = (
CheckState
)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uNewState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
6631
CheckState
oldValue = (
CheckState
)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uOldState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
6632
CheckState
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)
66
internal override void PaintUp(PaintEventArgs pevent,
CheckState
state)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (12)
13
private
CheckState
_checkState =
CheckState
.Unchecked;
14
private
CheckState
_prevCheckState =
CheckState
.Unchecked;
76
get => _checkState !=
CheckState
.Unchecked;
81
CheckState = value ?
CheckState
.Checked :
CheckState
.Unchecked;
91
[DefaultValue(
CheckState
.Unchecked)]
93
public
CheckState
CheckState
98
if (value is <
CheckState
.Unchecked or >
CheckState
.Indeterminate)
100
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
CheckState
));
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.ToolStripButtonAccessibleObject.cs (5)
82
internal void OnCheckStateChanged(
CheckState
oldValue,
CheckState
newValue)
90
private static ToggleState CheckStateToToggleState(
CheckState
checkState)
93
CheckState
.Checked => ToggleState.ToggleState_On,
94
CheckState
.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (10)
255
get => CheckState !=
CheckState
.Unchecked;
260
CheckState = value ?
CheckState
.Checked :
CheckState
.Unchecked;
272
CheckState
.Indeterminate => t_indeterminateCheckedImage ??= ScaleHelper.GetIconResourceAsBitmap(
276
CheckState
.Checked => t_checkedImage ??= ScaleHelper.GetIconResourceAsBitmap(
297
[DefaultValue(
CheckState
.Unchecked)]
300
public
CheckState
CheckState
302
get => Properties.GetValueOrDefault(s_propCheckState,
CheckState
.Unchecked);
310
Properties.AddOrRemoveValue(s_propCheckState, value, defaultValue:
CheckState
.Unchecked);
974
if (CheckState !=
CheckState
.Unchecked && menuItemInternalLayout.PaintCheck)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemAccessibleObject.cs (2)
144
CheckState
.Checked => ToggleState.ToggleState_On,
145
CheckState
.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (3)
349
if (item is not null && item.CheckState ==
CheckState
.Unchecked)
660
else if (item is ToolStripMenuItem menuItem && menuItem.CheckState ==
CheckState
.Checked)
749
if (item is not null && item.CheckState !=
CheckState
.Unchecked)
System\Windows\Forms\Internal\Formatter.cs (10)
16
private static readonly Type s_checkStateType = typeof(
CheckState
);
116
return
CheckState
.Indeterminate;
176
return ((bool)value) ?
CheckState
.Checked :
CheckState
.Unchecked;
185
?
CheckState
.Checked
186
:
CheckState
.Unchecked;
319
else if (value is
CheckState
state)
321
if (state ==
CheckState
.Indeterminate)
329
return (state ==
CheckState
.Checked);
336
return targetConverter.ConvertFrom(context: null, GetFormatterCulture(formatInfo), state ==
CheckState
.Checked);
System\Windows\Forms\ItemCheckEventArgs.cs (4)
11
public ItemCheckEventArgs(int index,
CheckState
newCheckValue,
CheckState
currentValue)
26
public
CheckState
NewValue { get; set; }
31
public
CheckState
CurrentValue { get; }
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (2)
351
_visibleCheckBox.CheckState =
CheckState
.Checked;
818
if (type == typeof(bool) || type == typeof(
CheckState
))
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
642
else 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)
362
ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>(() => box.SetItemCheckState(index,
CheckState
.Checked));
367
[EnumData<
CheckState
>]
368
public void CheckedListBox_SetItemCheckState_Invoke_GetReturnsExpected(
CheckState
value)
384
[InvalidEnumData<
CheckState
>]
385
public void CheckedListBox_SetItemCheckState_InvokeInvalidValue_ThrowsInvalidEnumArgumentException(
CheckState
value)
393
[InlineData(true,
CheckState
.Checked)]
394
[InlineData(false,
CheckState
.Unchecked)]
395
public void CheckedListBox_SetItemChecked(bool send,
CheckState
expected)
748
ItemCheckEventArgs eventArgs = new(0,
CheckState
.Checked,
CheckState
.Unchecked);
System\Windows\Forms\AccessibleObjects\CheckBox.CheckBoxAccessibleObjectTests.cs (24)
115
[InlineData(true,
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
116
[InlineData(true,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
117
[InlineData(true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
118
[InlineData(false,
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
119
[InlineData(false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
120
[InlineData(false,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
121
public void CheckBoxAccessibleObject_ToggleState_ReturnsExpected(bool createControl,
CheckState
checkState, int toggleState)
138
yield return new object[] { true, false,
CheckState
.Checked, (int)ToggleState.ToggleState_Off };
139
yield return new object[] { true, false,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Off };
140
yield return new object[] { true, false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_On };
142
yield return new object[] { true, true,
CheckState
.Checked, (int)ToggleState.ToggleState_Indeterminate };
143
yield return new object[] { true, true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Off };
144
yield return new object[] { true, true,
CheckState
.Unchecked, (int)ToggleState.ToggleState_On };
146
yield return new object[] { false, true,
CheckState
.Checked, (int)ToggleState.ToggleState_On };
147
yield return new object[] { false, true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate };
148
yield return new object[] { false, true,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off };
150
yield return new object[] { false, false,
CheckState
.Checked, (int)ToggleState.ToggleState_On };
151
yield return new object[] { false, false,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate };
152
yield return new object[] { false, false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off };
157
public void CheckBoxAccessibleObject_DoDefaultAction_Success(bool createControl, bool threeState,
CheckState
checkState, int toggleState)
265
Assert.Equal(
CheckState
.Unchecked, checkBox.CheckState);
268
Assert.Equal(
CheckState
.Checked, checkBox.CheckState);
272
Assert.Equal(
CheckState
.Indeterminate, checkBox.CheckState);
276
Assert.Equal(
CheckState
.Unchecked, checkBox.CheckState);
System\Windows\Forms\AccessibleObjects\CheckedListBoxItemAccessibleObjectTests.cs (7)
257
[InlineData(true,
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
258
[InlineData(false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
259
[InlineData(true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
260
public void CheckedListBoxItemAccessibleObject_ToggleState_ReturnsExpected(bool checkValue,
CheckState
checkState, int toggleState)
350
? (isChecked.Value ?
CheckState
.Checked :
CheckState
.Unchecked)
351
:
CheckState
.Indeterminate);
System\Windows\Forms\AccessibleObjects\DataGridViewCheckBoxCellAccessibleObjectTests.cs (3)
281
dataGridView.Rows.Add(
CheckState
.Indeterminate);
284
dataGridView.Rows.Add(
CheckState
.Checked);
287
dataGridView.Rows.Add(
CheckState
.Unchecked);
System\Windows\Forms\AccessibleObjects\ToolStripButton.ToolStripButtonAccessibleObjectTests.cs (11)
127
[InlineData(true,
CheckState
.Checked, true)]
128
[InlineData(true,
CheckState
.Unchecked, true)]
129
[InlineData(true,
CheckState
.Indeterminate, true)]
130
[InlineData(false,
CheckState
.Checked, true)]
131
[InlineData(false,
CheckState
.Unchecked, false)]
132
[InlineData(false,
CheckState
.Indeterminate, true)]
133
public void ToolStripButtonAccessibleObject_IsTogglePatternSupported_ReturnsExpected(bool checkOnClick,
CheckState
checkState, bool expected)
160
[InlineData(
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
161
[InlineData(
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
162
[InlineData(
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
163
public void ToolStripButtonAccessibleObject_ToggleState_ReturnsExpected(
CheckState
checkState, int expectedToggleState)
System\Windows\Forms\AccessibleObjects\ToolStripMenuItem.ToolStripMenuItemAccessibleObjectTests.cs (11)
200
[InlineData(true,
CheckState
.Checked, true)]
201
[InlineData(true,
CheckState
.Unchecked, true)]
202
[InlineData(true,
CheckState
.Indeterminate, true)]
203
[InlineData(false,
CheckState
.Checked, true)]
204
[InlineData(false,
CheckState
.Unchecked, false)]
205
[InlineData(false,
CheckState
.Indeterminate, true)]
206
public void ToolStripMenuItemAccessibleObject_IsTogglePatternSupported_ReturnsExpected(bool checkOnClick,
CheckState
checkState, bool expected)
220
[InlineData(
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
221
[InlineData(
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
222
[InlineData(
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
223
public void ToolStripMenuItemAccessibleObject_ToggleState_ReturnsExpected(
CheckState
checkState, int expectedToggleState)
System\Windows\Forms\CheckBoxTests.cs (33)
46
Assert.Equal(
CheckState
.Unchecked, control.CheckState);
211
[InlineData(true,
CheckState
.Checked)]
212
[InlineData(false,
CheckState
.Unchecked)]
213
public void CheckBox_CheckedGetSet(bool sent,
CheckState
expected)
224
[InlineData(true,
CheckState
.Checked, true,
CheckState
.Indeterminate)]
225
[InlineData(true,
CheckState
.Unchecked, true,
CheckState
.Checked)]
226
[InlineData(true,
CheckState
.Indeterminate, false,
CheckState
.Unchecked)]
227
[InlineData(false,
CheckState
.Checked, false,
CheckState
.Unchecked)]
228
[InlineData(false,
CheckState
.Unchecked, true,
CheckState
.Checked)]
229
[InlineData(false,
CheckState
.Indeterminate, false,
CheckState
.Unchecked)]
230
public void CheckBox_OnClick_AutoCheck_SetCorrectCheckState(bool threeState,
CheckState
checkState, bool expectedChecked,
CheckState
expectedCheckState)
246
[InlineData(true,
CheckState
.Checked, true)]
247
[InlineData(true,
CheckState
.Unchecked, false)]
248
[InlineData(true,
CheckState
.Indeterminate, true)]
249
[InlineData(false,
CheckState
.Checked, true)]
250
[InlineData(false,
CheckState
.Unchecked, false)]
251
[InlineData(false,
CheckState
.Indeterminate, true)]
252
public void CheckBox_OnClick_AutoCheckFalse_DoesNotChangeCheckState(bool threeState,
CheckState
expectedCheckState, bool expectedChecked)
268
[EnumData<
CheckState
>]
269
public void CheckBox_CheckState_Set_GetReturnsExpected(
CheckState
value)
285
[InvalidEnumData<
CheckState
>]
286
public void CheckBox_CheckState_SetInvalidValue_ThrowsInvalidEnumArgumentException(
CheckState
value)
771
checkBox.CheckState = checkBox.CheckState ==
CheckState
.Checked ?
CheckState
.Unchecked :
CheckState
.Checked;
873
checkBox.CheckState.Should().Be(
CheckState
.Checked);
System\Windows\Forms\DataGridViewCellTests.cs (22)
6134
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Indeterminate, new DataGridViewCellStyle(), null, null, DBNull.Value };
6135
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, null, true };
6136
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Unchecked, new DataGridViewCellStyle(), null, null, false };
6137
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Unchecked - 1, new DataGridViewCellStyle(), null, null, false };
6138
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Indeterminate + 1, new DataGridViewCellStyle(), null, null, false };
6139
yield return new object[] { typeof(
CheckState
), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, null,
CheckState
.Checked };
6140
yield return new object[] { typeof(int), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, null, 1 };
6141
yield return new object[] { typeof(int), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), new EnumConverter(typeof(
CheckState
)), null, 1 };
6142
yield return new object[] { typeof(int), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, new EnumConverter(typeof(
CheckState
)), 1 };
System\Windows\Forms\ToolStripButtonTests.cs (66)
40
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
121
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
208
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
298
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
386
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
484
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
638
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
639
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
640
public void ToolStripButton_Checked_Set_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
661
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
662
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
663
public void ToolStripButton_Checked_SetWithOwner_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
689
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
690
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
691
public void ToolStripButton_Checked_SetWithOwnerWithHandle_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
734
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
735
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
736
public void ToolStripButton_Checked_SetWithParent_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
762
[InlineData(true, 2,
CheckState
.Checked,
CheckState
.Unchecked)]
763
[InlineData(false, 0,
CheckState
.Unchecked,
CheckState
.Checked)]
764
public void ToolStripButton_Checked_SetWithParentWithHandle_GetReturnsExpected(bool value, int expectedInvalidatedCallCount,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
864
[EnumData<
CheckState
>]
865
public void ToolStripButton_CheckState_Set_GetReturnsExpected(
CheckState
value)
872
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
877
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
881
[EnumData<
CheckState
>]
882
public void ToolStripButton_CheckState_SetWithOwner_GetReturnsExpected(
CheckState
value)
891
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
897
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
902
[EnumData<
CheckState
>]
903
public void ToolStripButton_CheckState_SetWithOwnerWithHandle_GetReturnsExpected(
CheckState
value)
920
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
929
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
941
CheckState =
CheckState
.Checked
961
item.CheckState =
CheckState
.Unchecked;
962
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
967
item.CheckState =
CheckState
.Unchecked;
968
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
973
item.CheckState =
CheckState
.Indeterminate;
974
Assert.Equal(
CheckState
.Indeterminate, item.CheckState);
980
item.CheckState =
CheckState
.Unchecked;
981
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
987
item.CheckState =
CheckState
.Indeterminate;
988
Assert.Equal(
CheckState
.Indeterminate, item.CheckState);
994
[InvalidEnumData<
CheckState
>]
995
public void ToolStripButton_CheckState_SetInvalidValue_ThrowsInvalidEnumArgumentException(
CheckState
value)
1041
[InlineData(true,
CheckState
.Checked, AccessibleStates.Focusable | AccessibleStates.Checked)]
1042
[InlineData(true,
CheckState
.Indeterminate, AccessibleStates.Focusable | AccessibleStates.Checked)]
1043
[InlineData(false,
CheckState
.Checked, AccessibleStates.Unavailable)]
1044
[InlineData(false,
CheckState
.Indeterminate, AccessibleStates.Unavailable)]
1045
public void ToolStripButton_CreateAccessibilityInstance_InvokeChecked_ReturnsExpected(bool enabled,
CheckState
checkState, AccessibleStates expectedState)
System\Windows\Forms\ToolStripButtonTests.Rendering.cs (1)
100
toolStripButton.CheckState =
CheckState
.Indeterminate;
System\Windows\Forms\ToolStripMenuItemTests.cs (4)
50
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
279
CheckState =
CheckState
.Checked,
397
item.CheckState =
CheckState
.Checked;
401
item.CheckState =
CheckState
.Unchecked;
TestPassApp (11)
CommonControl1.Designer.cs (1)
292
this.checkBox1.CheckState = System.Windows.Forms.
CheckState
.Checked;
ContainerControls.Designer.cs (1)
339
this.checkBox2.CheckState = System.Windows.Forms.
CheckState
.Checked;
ContainerControls2.Designer.cs (1)
190
this.checkBox2.CheckState = System.Windows.Forms.
CheckState
.Checked;
Menu_Toolbars_controls.Designer.cs (8)
374
checkCheckOnClickToolStripMenuItem.CheckState =
CheckState
.Checked;
382
checkedCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Checked;
391
indeterminateToolStripMenuItem.CheckState =
CheckState
.Indeterminate;
399
indeterminateCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Indeterminate;
548
toolStripButton3.CheckState =
CheckState
.Checked;
559
toolStripButton4.CheckState =
CheckState
.Checked;
571
toolStripButton5.CheckState =
CheckState
.Indeterminate;
582
toolStripButton6.CheckState =
CheckState
.Indeterminate;
WinFormsControlsTest (25)
CustomComCtl32Button.cs (3)
26
CheckState =
CheckState
.Unchecked,
37
CheckState =
CheckState
.Checked,
81
isPressed = checkbox.CheckState ==
CheckState
.Checked;
MenuStripAndCheckedListBox.Designer.cs (4)
236
this.checkedToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Checked;
246
this.checkedCheckOnClickToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Checked;
255
this.indeterminateToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Indeterminate;
265
this.indeterminateCheckOnClickToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Indeterminate;
MultipleControls.cs (1)
132
checkedListBox1.Items.Add("Pennsylvania",
CheckState
.Checked);
MultipleControls.Designer.cs (4)
236
this.checkedListBox1.SetItemCheckState(0,
CheckState
.Checked);
237
this.checkedListBox1.SetItemCheckState(1,
CheckState
.Indeterminate);
294
this.checkedListBox2.SetItemCheckState(0,
CheckState
.Checked);
295
this.checkedListBox2.SetItemCheckState(1,
CheckState
.Indeterminate);
ToolStripTests.Designer.cs (13)
162
this.toolStrip2_Button1.CheckState = System.Windows.Forms.
CheckState
.Unchecked;
170
this.toolStrip2_Button2.CheckState = System.Windows.Forms.
CheckState
.Checked;
179
this.toolStrip2_Button3.CheckState = System.Windows.Forms.
CheckState
.Indeterminate;
188
this.toolStrip2_Button4.CheckState = System.Windows.Forms.
CheckState
.Unchecked;
222
this.toolStrip3_MenuItem1.CheckState = System.Windows.Forms.
CheckState
.Checked;
247
this.checkCheckOnClickToolStripMenuItem.CheckState =
CheckState
.Checked;
259
this.thirdLevelItem.CheckState = System.Windows.Forms.
CheckState
.Checked;
267
this.thirdLevelButton.CheckState = System.Windows.Forms.
CheckState
.Checked;
299
this.toolStripMenuItem1.CheckState = System.Windows.Forms.
CheckState
.Checked;
316
this.toolStripMenuItem2.CheckState = System.Windows.Forms.
CheckState
.Checked;
321
this.checkedCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Checked;
330
this.indeterminateToolStripMenuItem.CheckState =
CheckState
.Indeterminate;
338
this.indeterminateCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Indeterminate;