208 references to ButtonState
System.Windows.Forms (197)
winforms\Managed\System\WinForms\ButtonInternal\CheckBoxBaseAdapter.cs (8)
194protected ButtonState GetState() { 195ButtonState style = (ButtonState)0; 198style |= ButtonState.Normal; 201style |= ButtonState.Checked; 205style |= ButtonState.Inactive; 209style |= ButtonState.Pushed; 218ButtonState style = GetState();
winforms\Managed\System\WinForms\ButtonInternal\RadioButtonBaseAdapter.cs (8)
155protected ButtonState GetState() { 156ButtonState style = (ButtonState)0; 159style |= ButtonState.Checked; 162style |= ButtonState.Normal; 166style |= ButtonState.Inactive; 170style |= ButtonState.Pushed; 185ButtonState style = GetState();
winforms\Managed\System\WinForms\ButtonRenderer.cs (4)
257internal static ButtonState ConvertToButtonState(PushButtonState state) { 261return ButtonState.Pushed; 263return ButtonState.Inactive; 266return ButtonState.Normal;
winforms\Managed\System\WinForms\CheckBoxRenderer.cs (29)
244internal static ButtonState ConvertToButtonState(CheckBoxState state) { 249return ButtonState.Checked; 251return (ButtonState.Checked | ButtonState.Pushed); 253return (ButtonState.Checked | ButtonState.Inactive); 256return ButtonState.Pushed; 258return ButtonState.Inactive; 263return ButtonState.Checked; 265return (ButtonState.Checked | ButtonState.Pushed); 267return (ButtonState.Checked | ButtonState.Inactive); 270return ButtonState.Normal; 274internal static CheckBoxState ConvertFromButtonState(ButtonState state, bool isMixed, bool isHot) { 276if ((state & ButtonState.Pushed) == ButtonState.Pushed) { 279else if ((state & ButtonState.Inactive) == ButtonState.Inactive) { 288else if ((state & ButtonState.Checked) == ButtonState.Checked) { 289if ((state & ButtonState.Pushed) == ButtonState.Pushed) { 292else if ((state & ButtonState.Inactive) == ButtonState.Inactive) { 302if ((state & ButtonState.Pushed) == ButtonState.Pushed) { 305else if ((state & ButtonState.Inactive) == ButtonState.Inactive) {
winforms\Managed\System\WinForms\CheckedListBox.cs (6)
663ButtonState state = ButtonState.Normal; 665state |= ButtonState.Flat; 670state |= ButtonState.Checked; 673state |= ButtonState.Checked | ButtonState.Inactive;
winforms\Managed\System\WinForms\ControlPaint.cs (24)
1111public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state) { 1119public static void DrawButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) { 1128public static void DrawCaptionButton(Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state) { 1136public static void DrawCaptionButton(Graphics graphics, int x, int y, int width, int height, CaptionButton button, ButtonState state) { 1146public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) { 1154public static void DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state) { 1156if ((state & ButtonState.Flat) == ButtonState.Flat) { 1169public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state) { 1177public static void DrawComboButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) { 1232private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) { 1238Brush background = ((state & ButtonState.Inactive) == ButtonState.Inactive) ? 1241Color foreground = ((state & ButtonState.Inactive) == ButtonState.Inactive) ? 1254private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, Color foreground, Brush background, ButtonState state) { 1268if ((state & ButtonState.Checked) == ButtonState.Checked) { 1732public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) { 1740public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state) { 1749public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state) { 1757public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) { 1848public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state) { 1856public static void DrawScrollButton(Graphics graphics, int x, int y, int width, int height, ScrollButton button, ButtonState state) {
winforms\Managed\System\WinForms\DataGridBoolColumn.cs (6)
384ButtonState checkedState = ButtonState.Inactive; 386checkedState = ((bool)value ? ButtonState.Checked : ButtonState.Normal); 402if (checkedState == ButtonState.Inactive) { 403ControlPaint.DrawMixedCheckBox(g, box, ButtonState.Checked);
winforms\Managed\System\WinForms\DataGridViewButtonCell.cs (34)
49private ButtonState ButtonState 57return (ButtonState)buttonState; 59return ButtonState.Normal; 65Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 497return (this.ButtonState & ButtonState.Pushed) != 0; 515UpdateButtonState(this.ButtonState | ButtonState.Checked, rowIndex); 529UpdateButtonState(this.ButtonState & ~ButtonState.Checked, rowIndex); 551if (this.ButtonState != ButtonState.Normal) 554UpdateButtonState(ButtonState.Normal, rowIndex); 568UpdateButtonState(this.ButtonState | ButtonState.Pushed, e.RowIndex); 591if ((this.ButtonState & ButtonState.Pushed) != 0 && 595UpdateButtonState(this.ButtonState & ~ButtonState.Pushed, rowIndex); 620if ((this.ButtonState & ButtonState.Pushed) == 0 && 624UpdateButtonState(this.ButtonState | ButtonState.Pushed, e.RowIndex); 626else if ((this.ButtonState & ButtonState.Pushed) != 0 && !mouseInContentBounds) 628UpdateButtonState(this.ButtonState & ~ButtonState.Pushed, e.RowIndex); 645UpdateButtonState(this.ButtonState & ~ButtonState.Pushed, e.RowIndex); 766if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 793(this.ButtonState == ButtonState.Normal) ? ButtonBorderStyle.Outset : ButtonBorderStyle.Inset); 809if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 871if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 948if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0 || 980if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0 || 985bool paintUp = (this.ButtonState == ButtonState.Normal); 1017if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0 && 1066private void UpdateButtonState(ButtonState newButtonState, int rowIndex)
winforms\Managed\System\WinForms\DataGridViewCheckBoxCell.cs (31)
200private ButtonState ButtonState 208return (ButtonState)buttonState; 210return ButtonState.Normal; 216Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 892return (this.ButtonState & ButtonState.Pushed) != 0; 946UpdateButtonState(this.ButtonState | ButtonState.Checked, rowIndex); 960UpdateButtonState(this.ButtonState & ~ButtonState.Checked, rowIndex); 983if (this.ButtonState != ButtonState.Normal) 986UpdateButtonState(ButtonState.Normal, rowIndex); 1000UpdateButtonState(this.ButtonState | ButtonState.Pushed, e.RowIndex); 1023if ((this.ButtonState & ButtonState.Pushed) != 0 && 1027UpdateButtonState(this.ButtonState & ~ButtonState.Pushed, rowIndex); 1052if ((this.ButtonState & ButtonState.Pushed) == 0 && 1056UpdateButtonState(this.ButtonState | ButtonState.Pushed, e.RowIndex); 1058else if ((this.ButtonState & ButtonState.Pushed) != 0 && !mouseInContentBounds) 1060UpdateButtonState(this.ButtonState & ~ButtonState.Pushed, e.RowIndex); 1077UpdateButtonState(this.ButtonState & ~ButtonState.Pushed, e.RowIndex); 1180ButtonState bs; 1191bs = (checkState == CheckState.Unchecked) ? ButtonState.Normal : ButtonState.Checked; 1199bs = ButtonState.Checked; 1204bs = ButtonState.Normal; 1210bs = ButtonState.Normal; // Default rendering of the checkbox with wrong formatted value type. 1213if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 1215bs |= ButtonState.Pushed; 1468if ((this.ButtonState & (ButtonState.Pushed | ButtonState.Checked)) != 0) 1767private void UpdateButtonState(ButtonState newButtonState, int rowIndex)
winforms\Managed\System\WinForms\DataGridViewColumnHeaderCell.cs (2)
831if (this.ButtonState != ButtonState.Normal) 833Debug.Assert(this.ButtonState == ButtonState.Pushed);
winforms\Managed\System\WinForms\DataGridViewHeaderCell.cs (14)
41protected ButtonState ButtonState 49return (ButtonState) buttonState; 51return ButtonState.Normal; 55private ButtonState ButtonStatePrivate 62Debug.Assert(Enum.IsDefined(typeof(ButtonState), value)); 545return this.ButtonState != ButtonState.Normal && this.DataGridView.ApplyVisualStylesToHeaderCells; 565UpdateButtonState(ButtonState.Pushed, e.RowIndex); 580this.ButtonState == ButtonState.Normal && 584UpdateButtonState(ButtonState.Pushed, rowIndex); 599if (this.ButtonState != ButtonState.Normal) 601Debug.Assert(this.ButtonState == ButtonState.Pushed); 604UpdateButtonState(ButtonState.Normal, rowIndex); 619UpdateButtonState(ButtonState.Normal, e.RowIndex); 675private void UpdateButtonState(ButtonState newButtonState, int rowIndex)
winforms\Managed\System\WinForms\DataGridViewRowHeaderCell.cs (2)
818if (this.ButtonState != ButtonState.Normal) 820Debug.Assert(this.ButtonState == ButtonState.Pushed);
winforms\Managed\System\WinForms\DataGridViewTopLeftHeaderCell.cs (2)
289if (this.ButtonState != ButtonState.Normal) 291Debug.Assert(this.ButtonState == ButtonState.Pushed);
winforms\Managed\System\WinForms\RadioButtonRenderer.cs (20)
231internal static ButtonState ConvertToButtonState(RadioButtonState state) { 235return ButtonState.Checked; 237return (ButtonState.Checked | ButtonState.Pushed); 239return (ButtonState.Checked | ButtonState.Inactive); 242return ButtonState.Pushed; 244return ButtonState.Inactive; 247return ButtonState.Normal; 251internal static RadioButtonState ConvertFromButtonState(ButtonState state, bool isHot) { 252if ((state & ButtonState.Checked) == ButtonState.Checked) { 253if ((state & ButtonState.Pushed) == ButtonState.Pushed) { 256else if ((state & ButtonState.Inactive) == ButtonState.Inactive) { 266if ((state & ButtonState.Pushed) == ButtonState.Pushed) { 269else if ((state & ButtonState.Inactive) == ButtonState.Inactive) {
winforms\Managed\System\WinForms\ToolStripMenuItem.cs (1)
820ControlPaint.DrawCaptionButton(g, new Rectangle(Point.Empty, image.Size), (CaptionButton)buttonToUse, ButtonState.Flat);
winforms\Managed\System\WinForms\UpDownBase.cs (6)
1724pushed == ButtonID.Up ? ButtonState.Pushed : (Enabled ? ButtonState.Normal : ButtonState.Inactive)); 1729pushed == ButtonID.Down ? ButtonState.Pushed : (Enabled ? ButtonState.Normal : ButtonState.Inactive));
System.Workflow.ComponentModel (11)
AuthoringOM\Design\DesignerHelpers.cs (5)
290public static void Draw3DButton(Graphics graphics, Image image, Rectangle bounds, float transparency, ButtonState buttonState) 303if (buttonState == ButtonState.Normal || buttonState == ButtonState.Inactive) 312else if (buttonState == ButtonState.Pushed) 321DrawImage(graphics, image, bounds, new Rectangle(Point.Empty, image.Size), DesignerContentAlignment.Fill, transparency, (buttonState == ButtonState.Inactive));
AuthoringOM\Design\DesignerWidgets.cs (2)
3414ActivityDesignerPaint.Draw3DButton(graphics, null, this.previewModeButtonRectangle, 1.0f, (!PreviewMode) ? ButtonState.Pushed : ButtonState.Normal);
AuthoringOM\Design\MessageFilters\DynamicActionMessageFilter.cs (4)
535ActivityDesignerPaint.Draw3DButton(graphics, null, Bounds, this.transparency - 0.1f, ButtonState.Normal); 551ButtonState state = (button.State == ActionButton.States.Highlight) ? ButtonState.Normal : ButtonState.Pushed;