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); 1070ButtonState bs; 1082bs = (checkState == CheckState.Unchecked) ? ButtonState.Normal : ButtonState.Checked; 1090bs = ButtonState.Checked; 1095bs = ButtonState.Normal; 1101bs = ButtonState.Normal; // Default rendering of the checkbox with wrong formatted value type. 1105if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 1107bs |= ButtonState.Pushed; 1389if ((ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 1697private 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)
681if (ButtonState != ButtonState.Normal) 683Debug.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) 1746public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) 1749public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state) 1763public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state) 1769public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) 1845public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state) 1855ButtonState 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)
812foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 823public void ControlPaint_DrawButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 835public void ControlPaint_DrawButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 846[InlineData(ButtonState.All)] 847[InlineData(ButtonState.Normal)] 848public void ControlPaint_DrawButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 855[InlineData(0, 4, ButtonState.All)] 856[InlineData(0, 4, ButtonState.Normal)] 857[InlineData(3, 0, ButtonState.All)] 858[InlineData(3, 0, ButtonState.Normal)] 859[InlineData(0, 0, ButtonState.All)] 860[InlineData(0, 0, ButtonState.Normal)] 861public void ControlPaint_DrawButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 870[InlineData(ButtonState.All)] 871[InlineData(ButtonState.Normal)] 872public void ControlPaint_DrawButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 881[InlineData(ButtonState.All)] 882[InlineData(ButtonState.Normal)] 883public void ControlPaint_DrawButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 895foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 907public void ControlPaint_DrawCaptionButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, CaptionButton button, ButtonState state) 919public void ControlPaint_DrawCaptionButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, CaptionButton button, ButtonState state) 930[InlineData(ButtonState.All)] 931[InlineData(ButtonState.Normal)] 932public void ControlPaint_DrawCaptionButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 939[InlineData(0, 4, ButtonState.All)] 940[InlineData(0, 4, ButtonState.Normal)] 941[InlineData(3, 0, ButtonState.All)] 942[InlineData(3, 0, ButtonState.Normal)] 943[InlineData(0, 0, ButtonState.All)] 944public void ControlPaint_DrawCaptionButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 953[InlineData(ButtonState.All)] 954[InlineData(ButtonState.Normal)] 955public void ControlPaint_DrawCaptionButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 964[InlineData(ButtonState.All)] 965[InlineData(ButtonState.Normal)] 966public void ControlPaint_DrawCaptionButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 976foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 987public void ControlPaint_DrawCheckBox_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 999public void ControlPaint_DrawCheckBox_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1010[InlineData(ButtonState.All)] 1011[InlineData(ButtonState.Normal)] 1012public void ControlPaint_DrawCheckBox_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1019[InlineData(0, 4, ButtonState.All)] 1020[InlineData(0, 4, ButtonState.Normal)] 1021[InlineData(3, 0, ButtonState.All)] 1022[InlineData(3, 0, ButtonState.Normal)] 1023[InlineData(0, 0, ButtonState.All)] 1024[InlineData(0, 0, ButtonState.Normal)] 1025public void ControlPaint_DrawCheckBox_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1034[InlineData(ButtonState.All, "rectangle")] 1035[InlineData(ButtonState.Normal, "width")] 1036public void ControlPaint_DrawCheckBox_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state, string expectedParamName) 1045[InlineData(ButtonState.All, "rectangle")] 1046[InlineData(ButtonState.Normal, "height")] 1047public void ControlPaint_DrawCheckBox_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state, string expectedParamName) 1057foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1068public void ControlPaint_DrawComboButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 1080public void ControlPaint_DrawComboButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1091[InlineData(ButtonState.All)] 1092[InlineData(ButtonState.Normal)] 1093public void ControlPaint_DrawComboButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1100[InlineData(0, 4, ButtonState.All)] 1101[InlineData(0, 4, ButtonState.Normal)] 1102[InlineData(3, 0, ButtonState.All)] 1103[InlineData(3, 0, ButtonState.Normal)] 1104[InlineData(0, 0, ButtonState.All)] 1105public void ControlPaint_DrawComboButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1114[InlineData(ButtonState.All)] 1115[InlineData(ButtonState.Normal)] 1116public void ControlPaint_DrawComboButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1125[InlineData(ButtonState.All)] 1126[InlineData(ButtonState.Normal)] 1127public void ControlPaint_DrawComboButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 1518foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1529public void ControlPaint_DrawMixedCheckBox_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 1541public void ControlPaint_DrawMixedCheckBox_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1552[InlineData(ButtonState.All)] 1553[InlineData(ButtonState.Normal)] 1554public void ControlPaint_DrawMixedCheckBox_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1561[InlineData(0, 4, ButtonState.All)] 1562[InlineData(0, 4, ButtonState.Normal)] 1563[InlineData(3, 0, ButtonState.All)] 1564[InlineData(3, 0, ButtonState.Normal)] 1565[InlineData(0, 0, ButtonState.All)] 1566public void ControlPaint_DrawMixedCheckBox_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1575[InlineData(ButtonState.All)] 1576[InlineData(ButtonState.Normal)] 1577public void ControlPaint_DrawMixedCheckBox_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1586[InlineData(ButtonState.All)] 1587[InlineData(ButtonState.Normal)] 1588public void ControlPaint_DrawMixedCheckBox_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 1598foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1609public void ControlPaint_DrawRadioButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ButtonState state) 1621public void ControlPaint_DrawRadioButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ButtonState state) 1632[InlineData(ButtonState.All)] 1633[InlineData(ButtonState.Normal)] 1634public void ControlPaint_DrawRadioButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1641[InlineData(0, 4, ButtonState.All)] 1642[InlineData(0, 4, ButtonState.Normal)] 1643[InlineData(3, 0, ButtonState.All)] 1644[InlineData(3, 0, ButtonState.Normal)] 1645[InlineData(0, 0, ButtonState.All)] 1646public void ControlPaint_DrawRadioButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1655[InlineData(ButtonState.All)] 1656[InlineData(ButtonState.Normal)] 1657public void ControlPaint_DrawRadioButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1666[InlineData(ButtonState.All)] 1667[InlineData(ButtonState.Normal)] 1668public void ControlPaint_DrawRadioButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state) 1735foreach (ButtonState state in Enum.GetValues(typeof(ButtonState))) 1747public void ControlPaint_DrawScrollButton_InvokeGraphicsRectangleButtonState_Success(Rectangle rectangle, ScrollButton button, ButtonState state) 1759public void ControlPaint_DrawScrollButton_InvokeGraphicsIntIntIntIntButtonState_Success(Rectangle rectangle, ScrollButton button, ButtonState state) 1770[InlineData(ButtonState.All)] 1771[InlineData(ButtonState.Normal)] 1772public void ControlPaint_DrawScrollButton_NullGraphics_ThrowsArgumentNullException(ButtonState state) 1779[InlineData(0, 4, ButtonState.All)] 1780[InlineData(0, 4, ButtonState.Normal)] 1781[InlineData(3, 0, ButtonState.All)] 1782[InlineData(3, 0, ButtonState.Normal)] 1783[InlineData(0, 0, ButtonState.All)] 1784public void ControlPaint_DrawScrollButton_EmptyRectangle_ThrowsArgumentException(int width, int height, ButtonState state) 1793[InlineData(ButtonState.All)] 1794[InlineData(ButtonState.Normal)] 1795public void ControlPaint_DrawScrollButton_NegativeWidth_ThrowsArgumentOutOfRangeException(ButtonState state) 1804[InlineData(ButtonState.All)] 1805[InlineData(ButtonState.Normal)] 1806public void ControlPaint_DrawScrollButton_NegativeHeight_ThrowsArgumentOutOfRangeException(ButtonState state)
System\Windows\Forms\DataGridViewHeaderCellTests.cs (72)
18Assert.Equal(ButtonState.Normal, cell.ButtonState); 3834Assert.Equal(ButtonState.Normal, cell.ButtonState); 3888Assert.Equal(ButtonState.Normal, cell.ButtonState); 3910Assert.Equal(ButtonState.Normal, cell.ButtonState); 3918Assert.Equal(ButtonState.Normal, cell.ButtonState); 3930Assert.Equal(ButtonState.Normal, cell.ButtonState); 3956Assert.Equal(ButtonState.Normal, cell.ButtonState); 3969Assert.Equal(ButtonState.Normal, cell.ButtonState); 3995Assert.Equal(ButtonState.Normal, cell.ButtonState); 4001ButtonState expected = VisualStyleRenderer.IsSupported ? ButtonState.Pushed : ButtonState.Normal; 4006yield return new object[] { false, -2, ButtonState.Normal }; 4007yield return new object[] { false, -1, ButtonState.Normal }; 4008yield return new object[] { false, 0, ButtonState.Normal }; 4009yield return new object[] { false, 1, ButtonState.Normal }; 4014public void DataGridViewHeaderCell_MouseLeaveUnsharesRow_InvokeWithDataGridViewMouseDown_ReturnsExpected(bool enableHeadersVisualStylesParam, int rowIndexParam, ButtonState expectedButtonStateParam) 4021ButtonState expectedButtonState = (ButtonState)Enum.Parse(typeof(ButtonState), expectedButtonStateString); 4049Assert.Equal(ButtonState.Normal, cell.ButtonState); 4078Assert.Equal(ButtonState.Normal, cell.ButtonState); 4089Assert.Equal(ButtonState.Normal, cell.ButtonState); 4098Assert.Equal(ButtonState.Normal, cell.ButtonState); 4130Assert.Equal(ButtonState.Normal, cell.ButtonState); 4137yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, -1, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4138yield 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 }; 4139yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, -1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4140yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, -1, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4141yield 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 }; 4142yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, -1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4143yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, 0, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4144yield 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 }; 4145yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(-1, 0, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4146yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 0, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4147yield 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 }; 4148yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 0, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4149yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(1, 0, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4150yield 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 }; 4151yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4152yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)), ButtonState.Normal }; 4153yield return new object[] { enableHeadersVisualStyles, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Middle, 0, 0, 0, 0)), ButtonState.Normal }; 4156yield return new object[] { false, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), ButtonState.Normal }; 4169ButtonState expectedButtonState = (ButtonState)testData[2]; 4212Assert.Equal(VisualStyleRenderer.IsSupported ? ButtonState.Pushed : ButtonState.Normal, cell.ButtonState); 4228Assert.Equal(ButtonState.Normal, cell.ButtonState); 4240Assert.Equal(ButtonState.Normal, cell.ButtonState); 4270Assert.Equal(ButtonState.Normal, cell.ButtonState); 4308Assert.Equal(ButtonState.Normal, cell.ButtonState); 4338Assert.Equal(ButtonState.Normal, cell.ButtonState); 4397Assert.Equal(ButtonState.Normal, cell.ButtonState); 4427Assert.Equal(ButtonState.Normal, cell.ButtonState); 4437Assert.Equal(ButtonState.Normal, cell.ButtonState); 4485Assert.Equal(ButtonState.Normal, cell.ButtonState); 4517ButtonState expectedButtonState1 = enableHeadersVisualStyles && VisualStyleRenderer.IsSupported ? ButtonState.Pushed : ButtonState.Normal; 4518ButtonState expectedButtonState2 = enableHeadersVisualStyles && VisualStyleRenderer.IsSupported ? ButtonState.Normal : expectedButtonState1; 4538yield return new object[] { false, new DataGridViewCellMouseEventArgs(0, 1, 0, 0, new MouseEventArgs(MouseButtons.Left, 0, 0, 0, 0)), ButtonState.Normal }; 4551ButtonState expectedButtonState = (ButtonState)testData[2]; 4595Assert.Equal(ButtonState.Normal, cell.ButtonState); 4611Assert.Equal(ButtonState.Normal, cell.ButtonState); 4685public new ButtonState ButtonState => base.ButtonState;