1 write to Control
System.Windows.Forms (1)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
19internal ButtonBaseAdapter(ButtonBase control) => Control = control.OrThrowIfNull();
211 references to Control
System.Windows.Forms (211)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (66)
35if (Control.MouseIsDown) 39else if (Control.MouseIsOver) 73&& (Control.Focused || Control.MouseIsOver || (Control.IsDefault && Control.Enabled)); 91=> ControlPaint.CreateStringFormat(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic); 97=> ControlPaint.CreateTextFormatFlags(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic); 107if (Control.BackColor != SystemColors.Control && SystemInformation.HighContrast) 115ControlPaint.DrawBorderSimple(deviceContext, bounds, ControlPaint.Dark(Control.BackColor)); 134bool disabledHighContrast = (!Control.Enabled) && SystemInformation.HighContrast; 237bool disabledHighContrast = (!Control.Enabled) && SystemInformation.HighContrast; 370if (Control.Focused && Control.ShowFocusCues) 372ControlPaint.DrawFocusRectangle(g, r, Control.ForeColor, Control.BackColor); 385Control.Width - (2 * ButtonBorderSize), 386Control.Height - (2 * ButtonBorderSize)); 406if (!Control.Enabled) 458if (Control.UseCompatibleTextRendering) 466if ((Control.TextAlign & LayoutUtils.AnyCenter) == 0) 472if (disabledText3D && !Control.Enabled && !colors.Options.HighContrast) 476g.DrawString(Control.Text, Control.Font, highlightBrush, r, stringFormat); 480g.DrawString(Control.Text, Control.Font, shadowBrush, r, stringFormat); 486g.DrawString(Control.Text, Control.Font, brush, r, stringFormat); 493if (disabledText3D && !Control.Enabled && !colors.Options.HighContrast) 498TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.ButtonShadow, formatFlags); 503TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.Highlight, formatFlags); 506TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.ButtonShadow, formatFlags); 511TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, color, formatFlags); 520Control.PaintBackground(e, bounds); 550if (Control.Image is not null) 553DrawImageCore(e.GraphicsInternal, Control.Image, layout.ImageBounds, layout.ImageStart, layout); 594Client = LayoutUtils.DeflateRect(Control.ClientRectangle, Control.Padding), 595Padding = Control.Padding, 597IsDefault = Control.IsDefault, 602Font = Control.Font, 603Text = Control.Text, 604ImageSize = (Control.Image is null) ? Size.Empty : Control.Image.Size, 608ImageAlign = Control.ImageAlign, 609TextAlign = Control.TextAlign, 611ShadowedText = !Control.Enabled, 612LayoutRTL = Control.RightToLeft == RightToLeft.Yes, 613TextImageRelation = Control.TextImageRelation, 614UseCompatibleTextRendering = Control.UseCompatibleTextRendering 617if (Control.FlatStyle != FlatStyle.System) 621using StringFormat format = Control.CreateStringFormat(); 626layout.GdiTextFormatFlags = Control.CreateTextFormatFlags(); 643new(deviceContext, Control.ForeColor, Control.BackColor) 645Enabled = 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 (25)
41Control.ClientRectangle, 42Control.FlatStyle, 43ToPushButtonState(state, Control.Enabled), 44Control.IsDefault, 45Control.Focused, 46Control.ShowFocusCues, 47Control.Parent?.BackColor ?? Control.BackColor, 78Control.ClientRectangle, 79Control.FlatStyle, 81Control.IsDefault, 82Control.Focused, 83Control.ShowFocusCues, 84Control.Parent?.BackColor ?? Control.BackColor, 115Control.ClientRectangle, 116Control.FlatStyle, 118Control.IsDefault, 119Control.Focused, 120Control.ShowFocusCues, 121Control.Parent?.BackColor ?? Control.BackColor, 151new(deviceContext, Control.ForeColor, Control.BackColor) 153Enabled = 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; 91bool isHighContrastHighlighted = !Control.MouseIsDown && IsHighContrastHighlighted(); 92Color backgroundColor = isHighContrastHighlighted ? SystemColors.Highlight : Control.BackColor; 95using Image invertedImage = ControlPaint.CreateBitmapWithInvertedForeColor(bitmap, Control.BackColor);