1 write to Control
System.Windows.Forms (1)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
20internal ButtonBaseAdapter(ButtonBase control) => Control = control.OrThrowIfNull();
228 references to Control
System.Windows.Forms (228)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (74)
36if (Control.MouseIsDown) 40else if (Control.MouseIsOver) 105options.Client = LayoutUtils.DeflateRect(contentBounds, Control.Padding); 123&& (Control.Focused || Control.MouseIsOver || (Control.IsDefault && Control.Enabled)); 141=> ControlPaint.CreateStringFormat(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic); 147=> ControlPaint.CreateTextFormatFlags(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic); 157if (Control.BackColor != SystemColors.Control && SystemInformation.HighContrast) 165ControlPaint.DrawBorderSimple(deviceContext, bounds, ControlPaint.Dark(Control.BackColor)); 184bool disabledHighContrast = (!Control.Enabled) && SystemInformation.HighContrast; 287bool disabledHighContrast = (!Control.Enabled) && SystemInformation.HighContrast; 420if (Control.Focused && Control.ShowFocusCues) 422ControlPaint.DrawFocusRectangle(g, r, Control.ForeColor, Control.BackColor); 437Control.Width - (2 * ButtonBorderSize), 438Control.Height - (2 * ButtonBorderSize)); 462if (!Control.Enabled) 518if (Control.UseCompatibleTextRendering) 526if ((Control.TextAlign & LayoutUtils.AnyCenter) == 0) 532if (disabledText3D && !Control.Enabled && !colors.Options.HighContrast) 536g.DrawString(Control.Text, Control.Font, highlightBrush, r, stringFormat); 540g.DrawString(Control.Text, Control.Font, shadowBrush, r, stringFormat); 546g.DrawString(Control.Text, Control.Font, brush, r, stringFormat); 553if (disabledText3D && !Control.Enabled && !colors.Options.HighContrast) 558TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.ButtonShadow, formatFlags); 563TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.Highlight, formatFlags); 566TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.ButtonShadow, formatFlags); 571TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, color, formatFlags); 580Control.PaintBackground(e, bounds); 612if (Control.BackgroundImage is null 618Rectangle imageClip = clipRectangle ?? Control.ClientRectangle; 626Control.BackgroundImage, 628Control.BackgroundImageLayout, 629Control.ClientRectangle, 631Control.DisplayRectangle.Location, 632Control.RightToLeft); 640if (Control.Image is not null) 643DrawImageCore(e.GraphicsInternal, Control.Image, layout.ImageBounds, layout.ImageStart, layout); 684Client = LayoutUtils.DeflateRect(Control.ClientRectangle, Control.Padding), 685Padding = Control.Padding, 687IsDefault = Control.IsDefault, 692Font = Control.Font, 693Text = Control.Text, 694ImageSize = (Control.Image is null) ? Size.Empty : Control.Image.Size, 698ImageAlign = Control.ImageAlign, 699TextAlign = Control.TextAlign, 701ShadowedText = !Control.Enabled, 702LayoutRTL = Control.RightToLeft == RightToLeft.Yes, 703TextImageRelation = Control.TextImageRelation, 704UseCompatibleTextRendering = Control.UseCompatibleTextRendering 707if (Control.FlatStyle != FlatStyle.System) 711using StringFormat format = Control.CreateStringFormat(); 716layout.GdiTextFormatFlags = Control.CreateTextFormatFlags(); 733new(deviceContext, Control.ForeColor, Control.BackColor) 735Enabled = Control.Enabled
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (63)
17rect.Inflate(-Control.FlatAppearance.BorderSize, -Control.FlatAppearance.BorderSize); 18Control.PaintBackground(e, rect, backColor, rect.Location); 23bool hasCustomBorder = Control.FlatAppearance.BorderSize != BorderSize || !Control.FlatAppearance.BorderColor.IsEmpty; 27up: !Control.FlatAppearance.CheckedBackColor.IsEmpty 30Control.FlatAppearance.BorderSize).Layout(); 33if (!Control.FlatAppearance.BorderColor.IsEmpty) 35colors.WindowFrame = Control.FlatAppearance.BorderColor; 38Rectangle r = Control.ClientRectangle; 40Color backColor = Control.BackColor; 42if (!Control.FlatAppearance.CheckedBackColor.IsEmpty) 47backColor = Control.FlatAppearance.CheckedBackColor; 50backColor = Control.FlatAppearance.CheckedBackColor.MixColor(colors.ButtonFace); 69if (Control.IsDefault) 77if (Control.Focused && Control.ShowFocusCues) 82if (!(Control.IsDefault && Control.Focused && (Control.FlatAppearance.BorderSize == 0))) 84DrawDefaultBorder(e, r, colors.WindowFrame, Control.IsDefault); 90if (Control.FlatAppearance.BorderSize != BorderSize) 92DrawFlatBorderWithSize(e, r, colors.WindowFrame, Control.FlatAppearance.BorderSize); 116bool hasCustomBorder = (Control.FlatAppearance.BorderSize != BorderSize || !Control.FlatAppearance.BorderColor.IsEmpty); 120!Control.FlatAppearance.CheckedBackColor.IsEmpty 123Control.FlatAppearance.BorderSize).Layout(); 126if (!Control.FlatAppearance.BorderColor.IsEmpty) 128colors.WindowFrame = Control.FlatAppearance.BorderColor; 131Rectangle r = Control.ClientRectangle; 133Color backColor = Control.BackColor; 135if (!Control.FlatAppearance.MouseDownBackColor.IsEmpty) 137backColor = Control.FlatAppearance.MouseDownBackColor; 157if (Control.IsDefault) 165if (Control.Focused && Control.ShowFocusCues) 170if (!(Control.IsDefault && Control.Focused && (Control.FlatAppearance.BorderSize == 0))) 172DrawDefaultBorder(e, r, colors.WindowFrame, Control.IsDefault); 178if (Control.FlatAppearance.BorderSize != BorderSize) 180DrawFlatBorderWithSize(e, r, colors.WindowFrame, Control.FlatAppearance.BorderSize); 210bool hasCustomBorder = Control.FlatAppearance.BorderSize != BorderSize || !Control.FlatAppearance.BorderColor.IsEmpty; 214up: !Control.FlatAppearance.CheckedBackColor.IsEmpty || state == CheckState.Unchecked, 216Control.FlatAppearance.BorderSize).Layout(); 219if (!Control.FlatAppearance.BorderColor.IsEmpty) 221colors.WindowFrame = Control.FlatAppearance.BorderColor; 224Rectangle r = Control.ClientRectangle; 226Color backColor = !Control.FlatAppearance.MouseOverBackColor.IsEmpty 227? Control.FlatAppearance.MouseOverBackColor 228: !Control.FlatAppearance.CheckedBackColor.IsEmpty 230? Control.FlatAppearance.CheckedBackColor.MixColor(colors.LowButtonFace) 238if (Control.IsDefault) 254if (Control.Focused && Control.ShowFocusCues) 259if (!(Control.IsDefault && Control.Focused && (Control.FlatAppearance.BorderSize == 0))) 261DrawDefaultBorder(e, r, colors.WindowFrame, Control.IsDefault); 267if (Control.FlatAppearance.BorderSize != BorderSize) 269DrawFlatBorderWithSize(e, r, colors.WindowFrame, Control.FlatAppearance.BorderSize); 288PaintFlatLayout(up: false, check: true, Control.FlatAppearance.BorderSize);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (13)
18Rectangle r = Control.ClientRectangle; 27Control.PaintBackground(e, r, IsHighContrastHighlighted() ? SystemColors.Highlight : Control.BackColor, r.Location); 30if (Control.IsDefault) 47DrawDefaultBorder(e, r, borderColor, Control.IsDefault); 64Rectangle r = Control.ClientRectangle; 73Control.PaintBackground(e, r, IsHighContrastHighlighted() ? SystemColors.Highlight : Control.BackColor, r.Location); 76if (Control.IsDefault) 84DrawDefaultBorder(e, r, colors.Options.HighContrast ? colors.WindowText : colors.ButtonShadow, Control.IsDefault); 122Rectangle r = Control.ClientRectangle; 124if (Control.IsDefault) 135DrawDefaultBorder(e, r, colors.Options.HighContrast ? colors.WindowText : colors.WindowFrame, Control.IsDefault);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (25)
24else if (Control.MouseIsOver) 28else if (!Control.Enabled) 32else if (Control.Focused || Control.IsDefault) 53ButtonRenderer.DrawParentBackground(e, bounds, Control); 58Control.ClientRectangle, 61ScaleHelper.IsScalingRequirementMet ? Control.HWNDInternal : HWND.Null); 70if (!Control.UseVisualStyleBackColor) 73Color color = isHighContrastHighlighted ? SystemColors.Highlight : Control.BackColor; 87: Control.BackColorBrush); 92if (Control.BackgroundImage is not null && !DisplayInformation.HighContrast) 96Control.BackgroundImage, 98Control.BackgroundImageLayout, 99Control.ClientRectangle, 101Control.DisplayRectangle.Location, 102Control.RightToLeft); 122_ = Control as Button; 125PaintThemedButtonBackground(e, Control.ClientRectangle, up); 137Rectangle bounds = Control.ClientRectangle; 160if (Application.RenderWithVisualStyles && Control.FlatStyle != FlatStyle.Standard) 170if (Control.Focused && Control.ShowFocusCues) 187Rectangle r = Control.ClientRectangle; 188if (Control.IsDefault) 193DrawDefaultBorder(e, r, colors.WindowFrame, Control.IsDefault);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckableControlBaseAdapter.cs (4)
45if (Control is CheckBox checkBox) 50if (Control is RadioButton radioButton) 55Debug.Fail($"Unexpected control type '{Control.GetType().FullName}'"); 72internal double GetDpiScaleRatio() => GetDpiScaleRatio(Control);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (1)
26protected new CheckBox Control => (CheckBox)base.Control;
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\ButtonDarkModeAdapter.cs (34)
38_buttonDarkModeRenderer.DeviceDpi = Control.DeviceDpi; 50if (_modern && !Control.Enabled) 53Control.ForeColor, 58? Control.ShouldSerializeForeColor() 59: Control.ForeColor != Forms.Control.DefaultForeColor; 63textColor = Control.Enabled 64&& Control.EffectiveVisualStylesModeInternal >= VisualStylesMode.Net11 65? Control.ForeColor 66: new ColorOptions(deviceContext, Control.ForeColor, Control.BackColor) 68Enabled = Control.Enabled 78textColor = ButtonDarkModeRenderer.GetTextColor(state, Control.IsDefault, backColor); 88if (Control.BackColor != Forms.Control.DefaultBackColor) 92Control.IsDefault, 93Control.BackColor); 104Control.IsDefault, 110Control.BackColorAnimator.AnimateTo(backColor); 111backColor = Control.BackColorAnimator.CurrentColor; 118=> PaintCore(e, ToPushButtonState(state, Control.Enabled)); 135Color parentBackColor = Control.Parent?.BackColor ?? Control.BackColor; 139Control, 140Control.ClientRectangle, 141Control.FlatStyle, 143Control.IsDefault, 144Control.Focused, 145Control.ShowFocusCues, 170=> Control.FlatStyle == FlatStyle.Popup && _modern 174Control.DeviceDpi, 175Control.FlatAppearance.BorderSize) 186layout.DisableWordWrapping = Control.AutoSize; 197new(deviceContext, Control.ForeColor, Control.BackColor) 199Enabled = Control.Enabled
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (1)
12protected new RadioButton Control => (RadioButton)base.Control;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (13)
18if (Control.BackColor != SystemColors.Control && SystemInformation.HighContrast) 22Color c = ControlPaint.LightLight(Control.BackColor); 32ControlPaint.DrawBorderSimple(e, r, ControlPaint.Dark(Control.BackColor)); 39Color c = ControlPaint.Light(Control.BackColor); 44Control.BackColor, 2, ButtonBorderStyle.Outset, 45Control.BackColor, 2, ButtonBorderStyle.Outset); 51c = ControlPaint.LightLight(Control.BackColor); 61ControlPaint.DrawBorderSimple(e, r, ControlPaint.Dark(Control.BackColor)); 72DDB_Draw3DBorder(pevent, Control.ClientRectangle, raised: true); 77Rectangle rect = Control.ClientRectangle; 90bool isHighContrastHighlighted = !Control.MouseIsDown && IsHighContrastHighlighted(); 91Color backgroundColor = isHighContrastHighlighted ? SystemColors.Highlight : Control.BackColor; 94using Image invertedImage = ControlPaint.CreateBitmapWithInvertedForeColor(bitmap, Control.BackColor);