1 write to Control
System.Windows.Forms (1)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
19internal ButtonBaseAdapter(ButtonBase control) => Control = control.OrThrowIfNull();
186 references to Control
System.Windows.Forms (186)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (66)
34if (Control.MouseIsDown) 38else if (Control.MouseIsOver) 71&& (Control.Focused || Control.MouseIsOver || (Control.IsDefault && Control.Enabled)); 89=> ControlPaint.CreateStringFormat(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic); 95=> ControlPaint.CreateTextFormatFlags(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic); 105if (Control.BackColor != SystemColors.Control && SystemInformation.HighContrast) 113ControlPaint.DrawBorderSimple(deviceContext, bounds, ControlPaint.Dark(Control.BackColor)); 132bool disabledHighContrast = (!Control.Enabled) && SystemInformation.HighContrast; 235bool disabledHighContrast = (!Control.Enabled) && SystemInformation.HighContrast; 368if (Control.Focused && Control.ShowFocusCues) 370ControlPaint.DrawFocusRectangle(g, r, Control.ForeColor, Control.BackColor); 383Control.Width - (2 * ButtonBorderSize), 384Control.Height - (2 * ButtonBorderSize)); 404if (!Control.Enabled) 456if (Control.UseCompatibleTextRendering) 464if ((Control.TextAlign & LayoutUtils.AnyCenter) == 0) 470if (disabledText3D && !Control.Enabled && !colors.Options.HighContrast) 474g.DrawString(Control.Text, Control.Font, highlightBrush, r, stringFormat); 478g.DrawString(Control.Text, Control.Font, shadowBrush, r, stringFormat); 484g.DrawString(Control.Text, Control.Font, brush, r, stringFormat); 491if (disabledText3D && !Control.Enabled && !colors.Options.HighContrast) 496TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.ButtonShadow, formatFlags); 501TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.Highlight, formatFlags); 504TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, colors.ButtonShadow, formatFlags); 509TextRenderer.DrawTextInternal(e, Control.Text, Control.Font, r, color, formatFlags); 518Control.PaintBackground(e, bounds); 548if (Control.Image is not null) 551DrawImageCore(e.GraphicsInternal, Control.Image, layout.ImageBounds, layout.ImageStart, layout); 592Client = LayoutUtils.DeflateRect(Control.ClientRectangle, Control.Padding), 593Padding = Control.Padding, 595IsDefault = Control.IsDefault, 600Font = Control.Font, 601Text = Control.Text, 602ImageSize = (Control.Image is null) ? Size.Empty : Control.Image.Size, 606ImageAlign = Control.ImageAlign, 607TextAlign = Control.TextAlign, 609ShadowedText = !Control.Enabled, 610LayoutRTL = Control.RightToLeft == RightToLeft.Yes, 611TextImageRelation = Control.TextImageRelation, 612UseCompatibleTextRendering = Control.UseCompatibleTextRendering 615if (Control.FlatStyle != FlatStyle.System) 619using StringFormat format = Control.CreateStringFormat(); 624layout.GdiTextFormatFlags = Control.CreateTextFormatFlags(); 641new(deviceContext, Control.ForeColor, Control.BackColor) 643Enabled = 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; 227if (!Control.FlatAppearance.MouseOverBackColor.IsEmpty) 229backColor = Control.FlatAppearance.MouseOverBackColor; 231else if (!Control.FlatAppearance.CheckedBackColor.IsEmpty) 234? Control.FlatAppearance.CheckedBackColor.MixColor(colors.LowButtonFace) 246if (Control.IsDefault) 259if (Control.Focused && Control.ShowFocusCues) 264if (!(Control.IsDefault && Control.Focused && (Control.FlatAppearance.BorderSize == 0))) 266DrawDefaultBorder(e, r, colors.WindowFrame, Control.IsDefault); 272if (Control.FlatAppearance.BorderSize != BorderSize) 274DrawFlatBorderWithSize(e, r, colors.WindowFrame, Control.FlatAppearance.BorderSize); 293PaintFlatLayout(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\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)); 71DDB_Draw3DBorder(pevent, Control.ClientRectangle, raised: true); 76Rectangle rect = Control.ClientRectangle; 89bool isHighContrastHighlighted = !Control.MouseIsDown && IsHighContrastHighlighted(); 90Color backgroundColor = isHighContrastHighlighted ? SystemColors.Highlight : Control.BackColor; 93using Image invertedImage = ControlPaint.CreateBitmapWithInvertedForeColor(bitmap, Control.BackColor);