397 references to ButtonState
System.Windows.Forms (187)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (7)
232protected ButtonState GetState() 234ButtonState style = 0; 238style |= ButtonState.Normal; 242style |= ButtonState.Checked; 247style |= ButtonState.Inactive; 252style |= ButtonState.Pushed; 260ButtonState style = GetState();
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (7)
168protected ButtonState GetState() 170ButtonState style = default; 174style |= ButtonState.Checked; 178style |= ButtonState.Normal; 183style |= ButtonState.Inactive; 188style |= ButtonState.Pushed; 202ButtonState style = GetState();
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (4)
281internal static ButtonState ConvertToButtonState(PushButtonState state) => state switch 283PushButtonState.Pressed => ButtonState.Pushed, 284PushButtonState.Disabled => ButtonState.Inactive, 285_ => ButtonState.Normal,
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (29)
255internal static ButtonState ConvertToButtonState(CheckBoxState state) => state switch 257CheckBoxState.CheckedNormal or CheckBoxState.CheckedHot => ButtonState.Checked, 258CheckBoxState.CheckedPressed => (ButtonState.Checked | ButtonState.Pushed), 259CheckBoxState.CheckedDisabled => (ButtonState.Checked | ButtonState.Inactive), 260CheckBoxState.UncheckedPressed => ButtonState.Pushed, 261CheckBoxState.UncheckedDisabled => ButtonState.Inactive, 263CheckBoxState.MixedNormal or CheckBoxState.MixedHot => ButtonState.Checked, 264CheckBoxState.MixedPressed => (ButtonState.Checked | ButtonState.Pushed), 265CheckBoxState.MixedDisabled => (ButtonState.Checked | ButtonState.Inactive), 266_ => ButtonState.Normal, 269internal static CheckBoxState ConvertFromButtonState(ButtonState state, bool isMixed, bool isHot) 273if ((state & ButtonState.Pushed) == ButtonState.Pushed) 277else if ((state & ButtonState.Inactive) == ButtonState.Inactive) 288else if ((state & ButtonState.Checked) == ButtonState.Checked) 290if ((state & ButtonState.Pushed) == ButtonState.Pushed) 294else if ((state & ButtonState.Inactive) == ButtonState.Inactive) 308if ((state & ButtonState.Pushed) == ButtonState.Pushed) 312else if ((state & ButtonState.Inactive) == ButtonState.Inactive)
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (20)
268internal static ButtonState ConvertToButtonState(RadioButtonState state) => state switch 270RadioButtonState.CheckedNormal or RadioButtonState.CheckedHot => ButtonState.Checked, 271RadioButtonState.CheckedPressed => ButtonState.Checked | ButtonState.Pushed, 272RadioButtonState.CheckedDisabled => ButtonState.Checked | ButtonState.Inactive, 273RadioButtonState.UncheckedPressed => ButtonState.Pushed, 274RadioButtonState.UncheckedDisabled => ButtonState.Inactive, 275_ => ButtonState.Normal, 278internal static RadioButtonState ConvertFromButtonState(ButtonState state, bool isHot) 280if ((state & ButtonState.Checked) == ButtonState.Checked) 282if ((state & ButtonState.Pushed) == ButtonState.Pushed) 286else if ((state & ButtonState.Inactive) == ButtonState.Inactive) 300if ((state & ButtonState.Pushed) == ButtonState.Pushed) 304else if ((state & ButtonState.Inactive) == ButtonState.Inactive)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (34)
38private ButtonState ButtonState 40get => Properties.GetValueOrDefault(s_propButtonCellState, ButtonState.Normal); 45Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 48Properties.AddOrRemoveValue(s_propButtonCellState, value, defaultValue: ButtonState.Normal); 452ButtonState.HasFlag(ButtonState.Pushed); 466UpdateButtonState(ButtonState | ButtonState.Checked, rowIndex); 480UpdateButtonState(ButtonState & ~ButtonState.Checked, rowIndex); 503if (ButtonState != ButtonState.Normal) 506UpdateButtonState(ButtonState.Normal, rowIndex); 520UpdateButtonState(ButtonState | ButtonState.Pushed, e.RowIndex); 542if (ButtonState.HasFlag(ButtonState.Pushed) && 546UpdateButtonState(ButtonState & ~ButtonState.Pushed, rowIndex); 570if (!ButtonState.HasFlag(ButtonState.Pushed) && 574UpdateButtonState(ButtonState | ButtonState.Pushed, e.RowIndex); 576else if (ButtonState.HasFlag(ButtonState.Pushed) && !s_mouseInContentBounds) 578UpdateButtonState(ButtonState & ~ButtonState.Pushed, e.RowIndex); 595UpdateButtonState(ButtonState & ~ButtonState.Pushed, e.RowIndex); 724if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 753(ButtonState == ButtonState.Normal) ? ButtonBorderStyle.Outset : ButtonBorderStyle.Inset); 771if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 802if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 894if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0 || 929if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0 || 934bool paintUp = (ButtonState == ButtonState.Normal); 966if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0 && 1013private void UpdateButtonState(ButtonState newButtonState, int rowIndex)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (31)
180private ButtonState ButtonState 182get => Properties.GetValueOrDefault(s_propButtonCellState, ButtonState.Normal); 187Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 190Properties.AddOrRemoveValue(s_propButtonCellState, value, defaultValue: ButtonState.Normal); 770protected override bool MouseLeaveUnsharesRow(int rowIndex) => ButtonState.HasFlag(ButtonState.Pushed); 814UpdateButtonState(ButtonState | ButtonState.Checked, rowIndex); 828UpdateButtonState(ButtonState & ~ButtonState.Checked, rowIndex); 853if (ButtonState != ButtonState.Normal) 856UpdateButtonState(ButtonState.Normal, rowIndex); 870UpdateButtonState(ButtonState | ButtonState.Pushed, e.RowIndex); 892if (ButtonState.HasFlag(ButtonState.Pushed) && 896UpdateButtonState(ButtonState & ~ButtonState.Pushed, rowIndex); 920if (!ButtonState.HasFlag(ButtonState.Pushed) && 924UpdateButtonState(ButtonState | ButtonState.Pushed, e.RowIndex); 926else if (ButtonState.HasFlag(ButtonState.Pushed) && !s_mouseInContentBounds) 928UpdateButtonState(ButtonState & ~ButtonState.Pushed, e.RowIndex); 945UpdateButtonState(ButtonState & ~ButtonState.Pushed, e.RowIndex); 1078ButtonState bs; 1090bs = (checkState == CheckState.Unchecked) ? ButtonState.Normal : ButtonState.Checked; 1098bs = ButtonState.Checked; 1103bs = ButtonState.Normal; 1109bs = ButtonState.Normal; // Default rendering of the checkbox with wrong formatted value type. 1113if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 1115bs |= ButtonState.Pushed; 1397if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 1705private void UpdateButtonState(ButtonState newButtonState, int rowIndex)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (2)
803if (ButtonState != ButtonState.Normal) 805Debug.Assert(ButtonState == ButtonState.Pushed);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (12)
29protected ButtonState ButtonState 31get => Properties.GetValueOrDefault(s_propButtonState, ButtonState.Normal); 32private set => Properties.AddOrRemoveValue(s_propButtonState, value, defaultValue: ButtonState.Normal); 438DataGridView is not null && ButtonState != ButtonState.Normal && DataGridView.ApplyVisualStylesToHeaderCells; 454UpdateButtonState(ButtonState.Pushed, e.RowIndex); 469ButtonState == ButtonState.Normal && 473UpdateButtonState(ButtonState.Pushed, rowIndex); 489if (ButtonState != ButtonState.Normal) 491Debug.Assert(ButtonState == ButtonState.Pushed); 494UpdateButtonState(ButtonState.Normal, rowIndex); 510UpdateButtonState(ButtonState.Normal, e.RowIndex); 561private void UpdateButtonState(ButtonState newButtonState, int rowIndex)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (2)
685if (ButtonState != ButtonState.Normal) 687Debug.Assert(ButtonState == ButtonState.Pushed);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (2)
248if (ButtonState != ButtonState.Normal) 250Debug.Assert(ButtonState == ButtonState.Pushed);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (6)
501ButtonState state = ButtonState.Normal; 504state |= ButtonState.Flat; 512state |= ButtonState.Checked; 515state |= ButtonState.Checked | ButtonState.Inactive;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
711ControlPaint.DrawCaptionButton(g, new Rectangle(Point.Empty, image.Size), (CaptionButton)buttonToUse, ButtonState.Flat);
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (6)
309_pushed == ButtonID.Up ? ButtonState.Pushed : (Enabled ? ButtonState.Normal : ButtonState.Inactive)); 315_pushed == ButtonID.Down ? ButtonState.Pushed : (Enabled ? ButtonState.Normal : ButtonState.Inactive));
System\Windows\Forms\Rendering\ControlPaint.cs (24)
1179public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state) 1185public static void DrawButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) 1203ButtonState state) => DrawCaptionButton( 1216ButtonState state) => DrawFrameControl( 1227public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) 1233public static void DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state) 1236if ((state & ButtonState.Flat) == ButtonState.Flat) 1255public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state) 1261public static void DrawComboButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) 1317private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) 1323Brush background = ((state & ButtonState.Inactive) == ButtonState.Inactive) 1326Color foreground = ((state & ButtonState.Inactive) == ButtonState.Inactive) 1342ButtonState state) 1358if ((state & ButtonState.Checked) == ButtonState.Checked) 1745public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) 1748public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state) 1762public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state) 1768public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) 1844public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state) 1854ButtonState state) => DrawFrameControl(
System.Windows.Forms.Design (3)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
574ControlPaint.DrawButton(g, button, ButtonState.Normal);
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (1)
201ControlPaint.DrawButton(e.Graphics, rc, ButtonState.Normal);
System\Windows\Forms\Design\DockEditor.DockUI.cs (1)
302ControlPaint.DrawButton(e.Graphics, rc, ButtonState.Pushed);
System.Windows.Forms.Tests (207)
System\Windows\Forms\ControlPaintTests.cs (135)
814foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 825public void ControlPaint_DrawButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 837public void ControlPaint_DrawButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 848[InlineData(ButtonState.All)] 849[InlineData(ButtonState.Normal)] 850public void ControlPaint_DrawButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 857[InlineData(0, 4, ButtonState.All)] 858[InlineData(0, 4, ButtonState.Normal)] 859[InlineData(3, 0, ButtonState.All)] 860[InlineData(3, 0, ButtonState.Normal)] 861[InlineData(0, 0, ButtonState.All)] 862[InlineData(0, 0, ButtonState.Normal)] 863public void ControlPaint_DrawButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 872[InlineData(ButtonState.All)] 873[InlineData(ButtonState.Normal)] 874public void ControlPaint_DrawButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 883[InlineData(ButtonState.All)] 884[InlineData(ButtonState.Normal)] 885public void ControlPaint_DrawButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 897foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 909public void ControlPaint_DrawCaptionButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, CaptionButton button, ButtonState state) 921public void ControlPaint_DrawCaptionButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, CaptionButton button, ButtonState state) 932[InlineData(ButtonState.All)] 933[InlineData(ButtonState.Normal)] 934public void ControlPaint_DrawCaptionButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 941[InlineData(0, 4, ButtonState.All)] 942[InlineData(0, 4, ButtonState.Normal)] 943[InlineData(3, 0, ButtonState.All)] 944[InlineData(3, 0, ButtonState.Normal)] 945[InlineData(0, 0, ButtonState.All)] 946public void ControlPaint_DrawCaptionButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 955[InlineData(ButtonState.All)] 956[InlineData(ButtonState.Normal)] 957public void ControlPaint_DrawCaptionButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 966[InlineData(ButtonState.All)] 967[InlineData(ButtonState.Normal)] 968public void ControlPaint_DrawCaptionButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 978foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 989public void ControlPaint_DrawCheckBox_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 1001public void ControlPaint_DrawCheckBox_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1012[InlineData(ButtonState.All)] 1013[InlineData(ButtonState.Normal)] 1014public void ControlPaint_DrawCheckBox_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1021[InlineData(0, 4, ButtonState.All)] 1022[InlineData(0, 4, ButtonState.Normal)] 1023[InlineData(3, 0, ButtonState.All)] 1024[InlineData(3, 0, ButtonState.Normal)] 1025[InlineData(0, 0, ButtonState.All)] 1026[InlineData(0, 0, ButtonState.Normal)] 1027public void ControlPaint_DrawCheckBox_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1036[InlineData(ButtonState.All, "rectangle")] 1037[InlineData(ButtonState.Normal, "width")] 1038public void ControlPaint_DrawCheckBox_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state, string expectedParamName) 1047[InlineData(ButtonState.All, "rectangle")] 1048[InlineData(ButtonState.Normal, "height")] 1049public void ControlPaint_DrawCheckBox_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state, string expectedParamName) 1059foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1070public void ControlPaint_DrawComboButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 1082public void ControlPaint_DrawComboButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1093[InlineData(ButtonState.All)] 1094[InlineData(ButtonState.Normal)] 1095public void ControlPaint_DrawComboButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1102[InlineData(0, 4, ButtonState.All)] 1103[InlineData(0, 4, ButtonState.Normal)] 1104[InlineData(3, 0, ButtonState.All)] 1105[InlineData(3, 0, ButtonState.Normal)] 1106[InlineData(0, 0, ButtonState.All)] 1107public void ControlPaint_DrawComboButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1116[InlineData(ButtonState.All)] 1117[InlineData(ButtonState.Normal)] 1118public void ControlPaint_DrawComboButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1127[InlineData(ButtonState.All)] 1128[InlineData(ButtonState.Normal)] 1129public void ControlPaint_DrawComboButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 1520foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1531public void ControlPaint_DrawMixedCheckBox_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 1543public void ControlPaint_DrawMixedCheckBox_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1554[InlineData(ButtonState.All)] 1555[InlineData(ButtonState.Normal)] 1556public void ControlPaint_DrawMixedCheckBox_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1563[InlineData(0, 4, ButtonState.All)] 1564[InlineData(0, 4, ButtonState.Normal)] 1565[InlineData(3, 0, ButtonState.All)] 1566[InlineData(3, 0, ButtonState.Normal)] 1567[InlineData(0, 0, ButtonState.All)] 1568public void ControlPaint_DrawMixedCheckBox_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1577[InlineData(ButtonState.All)] 1578[InlineData(ButtonState.Normal)] 1579public void ControlPaint_DrawMixedCheckBox_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1588[InlineData(ButtonState.All)] 1589[InlineData(ButtonState.Normal)] 1590public void ControlPaint_DrawMixedCheckBox_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 1600foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1611public void ControlPaint_DrawRadioButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 1623public void ControlPaint_DrawRadioButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1634[InlineData(ButtonState.All)] 1635[InlineData(ButtonState.Normal)] 1636public void ControlPaint_DrawRadioButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1643[InlineData(0, 4, ButtonState.All)] 1644[InlineData(0, 4, ButtonState.Normal)] 1645[InlineData(3, 0, ButtonState.All)] 1646[InlineData(3, 0, ButtonState.Normal)] 1647[InlineData(0, 0, ButtonState.All)] 1648public void ControlPaint_DrawRadioButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1657[InlineData(ButtonState.All)] 1658[InlineData(ButtonState.Normal)] 1659public void ControlPaint_DrawRadioButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1668[InlineData(ButtonState.All)] 1669[InlineData(ButtonState.Normal)] 1670public void ControlPaint_DrawRadioButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 1737foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1749public void ControlPaint_DrawScrollButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ScrollButton button, ButtonState state) 1761public void ControlPaint_DrawScrollButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ScrollButton button, ButtonState state) 1772[InlineData(ButtonState.All)] 1773[InlineData(ButtonState.Normal)] 1774public void ControlPaint_DrawScrollButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1781[InlineData(0, 4, ButtonState.All)] 1782[InlineData(0, 4, ButtonState.Normal)] 1783[InlineData(3, 0, ButtonState.All)] 1784[InlineData(3, 0, ButtonState.Normal)] 1785[InlineData(0, 0, ButtonState.All)] 1786public void ControlPaint_DrawScrollButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1795[InlineData(ButtonState.All)] 1796[InlineData(ButtonState.Normal)] 1797public void ControlPaint_DrawScrollButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1806[InlineData(ButtonState.All)] 1807[InlineData(ButtonState.Normal)] 1808public void ControlPaint_DrawScrollButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state)
System\Windows\Forms\DataGridViewHeaderCellTests.cs (72)
20Assert.Equal(ButtonState.Normal, cell.ButtonState); 3836Assert.Equal(ButtonState.Normal, cell.ButtonState); 3890Assert.Equal(ButtonState.Normal, cell.ButtonState); 3912Assert.Equal(ButtonState.Normal, cell.ButtonState); 3920Assert.Equal(ButtonState.Normal, cell.ButtonState); 3932Assert.Equal(ButtonState.Normal, cell.ButtonState); 3958Assert.Equal(ButtonState.Normal, cell.ButtonState); 3971Assert.Equal(ButtonState.Normal, cell.ButtonState); 3997Assert.Equal(ButtonState.Normal, cell.ButtonState); 4003ButtonState expected = VisualStyleRenderer.IsSupported ? ButtonState.Pushed : ButtonState.Normal; 4008yield return new object[] { false, -2, ButtonState.Normal }; 4009yield return new object[] { false, -1, ButtonState.Normal }; 4010yield return new object[] { false, 0, ButtonState.Normal }; 4011yield return new object[] { false, 1, ButtonState.Normal }; 4016public void DataGridViewHeaderCell_MouseLeaveUnsharesRow_InvokeWithDataGridViewMouseDown_ReturnsExpected(bool enableHeadersVisualStylesParam, int rowIndexParam, ButtonState expectedButtonStateParam) 4023ButtonState expectedButtonState = (ButtonState)Enum.Parse(typeof(ButtonState), expectedButtonStateString); 4051Assert.Equal(ButtonState.Normal, cell.ButtonState); 4080Assert.Equal(ButtonState.Normal, cell.ButtonState); 4091Assert.Equal(ButtonState.Normal, cell.ButtonState); 4100Assert.Equal(ButtonState.Normal, cell.ButtonState); 4132Assert.Equal(ButtonState.Normal, cell.ButtonState); 4139yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, -1, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4140yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, -1, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), VisualStyleRenderer.IsSupported && enableHeadersVisualStyles ? ButtonState.Pushed : ButtonState.Normal }; 4141yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, -1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4142yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, -1, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4143yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, -1, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), VisualStyleRenderer.IsSupported && enableHeadersVisualStyles ? ButtonState.Pushed : ButtonState.Normal }; 4144yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, -1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4145yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, 0, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4146yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, 0, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), VisualStyleRenderer.IsSupported && enableHeadersVisualStyles ? ButtonState.Pushed : ButtonState.Normal }; 4147yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, 0, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4148yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 0, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4149yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 0, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), VisualStyleRenderer.IsSupported && enableHeadersVisualStyles ? ButtonState.Pushed : ButtonState.Normal }; 4150yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 0, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4151yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(1, 0, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4152yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(1, 0, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), VisualStyleRenderer.IsSupported && enableHeadersVisualStyles ? ButtonState.Pushed : ButtonState.Normal }; 4153yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4154yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4155yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4158yield return new object[] { false, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), ButtonState.Normal }; 4171ButtonState expectedButtonState = (ButtonState)testData[2]; 4214Assert.Equal(VisualStyleRenderer.IsSupported ? ButtonState.Pushed : ButtonState.Normal, cell.ButtonState); 4230Assert.Equal(ButtonState.Normal, cell.ButtonState); 4242Assert.Equal(ButtonState.Normal, cell.ButtonState); 4272Assert.Equal(ButtonState.Normal, cell.ButtonState); 4310Assert.Equal(ButtonState.Normal, cell.ButtonState); 4340Assert.Equal(ButtonState.Normal, cell.ButtonState); 4399Assert.Equal(ButtonState.Normal, cell.ButtonState); 4429Assert.Equal(ButtonState.Normal, cell.ButtonState); 4439Assert.Equal(ButtonState.Normal, cell.ButtonState); 4487Assert.Equal(ButtonState.Normal, cell.ButtonState); 4519ButtonState expectedButtonState1 = enableHeadersVisualStyles && VisualStyleRenderer.IsSupported ? ButtonState.Pushed : ButtonState.Normal; 4520ButtonState expectedButtonState2 = enableHeadersVisualStyles && VisualStyleRenderer.IsSupported ? ButtonState.Normal : expectedButtonState1; 4540yield return new object[] { false, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), ButtonState.Normal }; 4553ButtonState expectedButtonState = (ButtonState)testData[2]; 4597Assert.Equal(ButtonState.Normal, cell.ButtonState); 4613Assert.Equal(ButtonState.Normal, cell.ButtonState); 4687public new ButtonState ButtonState => base.ButtonState;