188 references to Control
System.Windows.Forms (188)
winforms\Managed\System\WinForms\ButtonInternal\ButtonBaseAdapter.cs (67)
43
if (
Control
.MouseIsDown) {
46
else if (
Control
.MouseIsOver) {
87
(
Control
.Focused ||
Control
.MouseIsOver || (
Control
.IsDefault &&
Control
.Enabled));
136
return ControlPaint.CreateStringFormat(
Control
,
Control
.TextAlign,
Control
.ShowToolTip,
Control
.UseMnemonic );
143
return ControlPaint.CreateTextFormatFlags(
Control
,
Control
.TextAlign,
Control
.ShowToolTip,
Control
.UseMnemonic );
153
if (
Control
.BackColor != SystemColors.Control && SystemInformation.HighContrast) {
158
ControlPaint.DrawBorder(g, bounds, ControlPaint.Dark(
Control
.BackColor), ButtonBorderStyle.Solid);
174
bool disabledHighContrast = (!
Control
.Enabled) && SystemInformation.HighContrast && AccessibilityImprovements.Level1;
338
bool disabledHighContrast = (!
Control
.Enabled) && SystemInformation.HighContrast && AccessibilityImprovements.Level1;
542
if (
Control
.Focused &&
Control
.ShowFocusCues) {
543
ControlPaint.DrawFocusRectangle(g, r,
Control
.ForeColor,
Control
.BackColor);
551
if (
Control
.Image != null) {
553
DrawImageCore(graphics,
Control
.Image, layout.imageBounds, layout.imageStart, layout);
562
Rectangle bounds = new Rectangle(buttonBorderSize, buttonBorderSize, this.
Control
.Width - (2 * buttonBorderSize), this.
Control
.Height - (2 * buttonBorderSize));
582
if (!
Control
.Enabled)
584
ControlPaint.DrawImageDisabled(graphics, image, imageBounds,
Control
.BackColor, true /* unscaled image*/);
623
if (
Control
.UseCompatibleTextRendering) { // Draw text using GDI+
626
if ((
Control
.TextAlign & LayoutUtils.AnyCenter) == 0) {
630
if (disabledText3D && !
Control
.Enabled &&
634
g.DrawString(
Control
.Text,
Control
.Font, brush, r, stringFormat);
638
g.DrawString(
Control
.Text,
Control
.Font, brush, r, stringFormat);
650
g.DrawString(
Control
.Text,
Control
.Font, brush, r, stringFormat);
660
if (disabledText3D && !
Control
.Enabled && (!AccessibilityImprovements.Level1 || (!colors.options.highContrast && AccessibilityImprovements.Level1))) {
663
TextRenderer.DrawText(g,
Control
.Text,
Control
.Font, r, colors.buttonShadow, formatFlags);
667
TextRenderer.DrawText(g,
Control
.Text,
Control
.Font, r, colors.highlight, formatFlags);
670
TextRenderer.DrawText(g,
Control
.Text,
Control
.Font, r, colors.buttonShadow, formatFlags);
674
TextRenderer.DrawText(g,
Control
.Text,
Control
.Font, r, c, formatFlags);
690
Control
.PaintBackground(e, bounds);
1536
layout.client = LayoutUtils.DeflateRect(
Control
.ClientRectangle,
Control
.Padding);
1537
layout.padding =
Control
.Padding;
1539
layout.isDefault =
Control
.IsDefault;
1544
layout.font =
Control
.Font;
1545
layout.text =
Control
.Text;
1546
layout.imageSize = (
Control
.Image == null) ? Size.Empty :
Control
.Image.Size;
1550
layout.imageAlign =
Control
.ImageAlign;
1551
layout.textAlign =
Control
.TextAlign;
1553
layout.shadowedText = !
Control
.Enabled;
1554
layout.layoutRTL = RightToLeft.Yes ==
Control
.RightToLeft;
1555
layout.textImageRelation =
Control
.TextImageRelation;
1556
layout.useCompatibleTextRendering =
Control
.UseCompatibleTextRendering;
1558
if(
Control
.FlatStyle != FlatStyle.System ) {
1560
using( StringFormat format =
Control
.CreateStringFormat() ) {
1565
layout.gdiTextFormatFlags =
Control
.CreateTextFormatFlags();
1580
ColorOptions colors = new ColorOptions(g,
Control
.ForeColor,
Control
.BackColor);
1581
colors.enabled =
Control
.Enabled;
winforms\Managed\System\WinForms\ButtonInternal\ButtonFlatAdapter.cs (64)
27
rect.Inflate(-
Control
.FlatAppearance.BorderSize,-
Control
.FlatAppearance.BorderSize);
28
Control
.PaintBackground(e, rect, backColor, rect.Location);
32
bool hasCustomBorder = (
Control
.FlatAppearance.BorderSize != BORDERSIZE || !
Control
.FlatAppearance.BorderColor.IsEmpty);
36
!
Control
.FlatAppearance.CheckedBackColor.IsEmpty || (SystemInformation.HighContrast ? state != CheckState.Indeterminate : state == CheckState.Unchecked),
38
Control
.FlatAppearance.BorderSize).Layout();
42
if (!
Control
.FlatAppearance.BorderColor.IsEmpty) {
43
colors.windowFrame =
Control
.FlatAppearance.BorderColor;
49
Rectangle r =
Control
.ClientRectangle;
51
Color backColor =
Control
.BackColor;
53
if (!
Control
.FlatAppearance.CheckedBackColor.IsEmpty) {
56
backColor =
Control
.FlatAppearance.CheckedBackColor;
59
backColor = MixedColor(
Control
.FlatAppearance.CheckedBackColor, colors.buttonFace);
76
if (
Control
.IsDefault) {
83
if (
Control
.Focused &&
Control
.ShowFocusCues) {
88
if (!(
Control
.IsDefault &&
Control
.Focused && (
Control
.FlatAppearance.BorderSize == 0))) {
89
DrawDefaultBorder(g, r, colors.windowFrame, this.
Control
.IsDefault);
94
if (
Control
.FlatAppearance.BorderSize != BORDERSIZE) {
95
DrawFlatBorderWithSize(g, r, colors.windowFrame,
Control
.FlatAppearance.BorderSize);
114
bool hasCustomBorder = (
Control
.FlatAppearance.BorderSize != BORDERSIZE || !
Control
.FlatAppearance.BorderColor.IsEmpty);
118
!
Control
.FlatAppearance.CheckedBackColor.IsEmpty || (SystemInformation.HighContrast ? state != CheckState.Indeterminate : state == CheckState.Unchecked),
120
Control
.FlatAppearance.BorderSize).Layout();
123
if (!
Control
.FlatAppearance.BorderColor.IsEmpty) {
124
colors.windowFrame =
Control
.FlatAppearance.BorderColor;
130
Rectangle r =
Control
.ClientRectangle;
132
Color backColor =
Control
.BackColor;
134
if (!
Control
.FlatAppearance.MouseDownBackColor.IsEmpty) {
135
backColor =
Control
.FlatAppearance.MouseDownBackColor;
151
if (
Control
.IsDefault) {
158
if (
Control
.Focused &&
Control
.ShowFocusCues) {
162
if (!(
Control
.IsDefault &&
Control
.Focused && (
Control
.FlatAppearance.BorderSize == 0))) {
163
DrawDefaultBorder(g, r, colors.windowFrame, this.
Control
.IsDefault);
168
if (
Control
.FlatAppearance.BorderSize != BORDERSIZE) {
169
DrawFlatBorderWithSize(g, r, colors.windowFrame,
Control
.FlatAppearance.BorderSize);
192
bool hasCustomBorder = (
Control
.FlatAppearance.BorderSize != BORDERSIZE || !
Control
.FlatAppearance.BorderColor.IsEmpty);
196
!
Control
.FlatAppearance.CheckedBackColor.IsEmpty || state == CheckState.Unchecked,
198
Control
.FlatAppearance.BorderSize).Layout();
202
if (!
Control
.FlatAppearance.BorderColor.IsEmpty) {
203
colors.windowFrame =
Control
.FlatAppearance.BorderColor;
209
Rectangle r =
Control
.ClientRectangle;
211
Color backColor =
Control
.BackColor;
213
if (!
Control
.FlatAppearance.MouseOverBackColor.IsEmpty) {
214
backColor =
Control
.FlatAppearance.MouseOverBackColor;
216
else if (!
Control
.FlatAppearance.CheckedBackColor.IsEmpty) {
218
backColor = MixedColor(
Control
.FlatAppearance.CheckedBackColor, colors.lowButtonFace);
235
if (
Control
.IsDefault) {
242
if (
Control
.Focused &&
Control
.ShowFocusCues) {
246
if (!(
Control
.IsDefault &&
Control
.Focused && (
Control
.FlatAppearance.BorderSize == 0))) {
247
DrawDefaultBorder(g, r, colors.windowFrame, this.
Control
.IsDefault);
252
if (
Control
.FlatAppearance.BorderSize != BORDERSIZE) {
253
DrawFlatBorderWithSize(g, r, colors.windowFrame,
Control
.FlatAppearance.BorderSize);
272
LayoutOptions layout = PaintFlatLayout(e, /* up = */ false, /* check = */ true,
Control
.FlatAppearance.BorderSize);
winforms\Managed\System\WinForms\ButtonInternal\ButtonPopupAdapter.cs (13)
30
Rectangle r =
Control
.ClientRectangle;
43
Control
.PaintBackground(e, r, IsHighContrastHighlighted2() ? SystemColors.Highlight :
Control
.BackColor, r.Location);
46
if (
Control
.IsDefault) {
53
DrawDefaultBorder(g, r, colors.options.highContrast ? colors.windowText : colors.buttonShadow, this.
Control
.IsDefault);
70
Rectangle r =
Control
.ClientRectangle;
83
Control
.PaintBackground(e, r, IsHighContrastHighlighted2() ? SystemColors.Highlight :
Control
.BackColor, r.Location);
86
if (
Control
.IsDefault) {
93
DrawDefaultBorder(g, r, colors.options.highContrast ? colors.windowText : colors.buttonShadow, this.
Control
.IsDefault);
131
Rectangle r =
Control
.ClientRectangle;
133
if (
Control
.IsDefault) {
142
DrawDefaultBorder(g, r, colors.options.highContrast ? colors.windowText : colors.windowFrame, this.
Control
.IsDefault);
winforms\Managed\System\WinForms\ButtonInternal\ButtonStandardAdapter.cs (25)
37
else if (
Control
.MouseIsOver) {
40
else if (!
Control
.Enabled) {
43
else if (
Control
.Focused ||
Control
.IsDefault) {
68
ButtonRenderer.DrawParentBackground(e.Graphics, bounds,
Control
);
73
ButtonRenderer.DrawButton(e.Graphics,
Control
.ClientRectangle, false, pbState);
76
ButtonRenderer.DrawButtonForHandle(e.Graphics,
Control
.ClientRectangle, false, pbState, this.
Control
.HandleInternal);
88
if (!
Control
.UseVisualStyleBackColor) {
91
Color color = isHighContrastHighlighted ? SystemColors.Highlight :
Control
.BackColor;
101
isHighContrastHighlighted ? SafeNativeMethods.GetSysColorBrush(ColorTranslator.ToOle(color) & 0xFF) :
Control
.BackColorBrush));
126
if (
Control
.BackgroundImage != null && !DisplayInformation.HighContrast) {
127
ControlPaint.DrawBackgroundImage(e.Graphics,
Control
.BackgroundImage, Color.Transparent,
Control
.BackgroundImageLayout,
Control
.ClientRectangle, bounds,
Control
.DisplayRectangle.Location,
Control
.RightToLeft);
149
Button thisbutton = this.
Control
as Button;
151
PaintThemedButtonBackground(e,
Control
.ClientRectangle, up);
160
Rectangle bounds =
Control
.ClientRectangle;
190
if (
Control
.Focused &&
Control
.ShowFocusCues) {
203
Rectangle r =
Control
.ClientRectangle;
204
if (
Control
.IsDefault) {
208
DrawDefaultBorder(g, r, colors.windowFrame, this.
Control
.IsDefault);
winforms\Managed\System\WinForms\ButtonInternal\CheckableControlBaseAdapter.cs (4)
51
CheckBox checkBox =
Control
as CheckBox;
56
RadioButton radioButton =
Control
as RadioButton;
61
Debug.Fail("Unexpected control type '" +
Control
.GetType().FullName + "'");
78
return GetDpiScaleRatio(g,
Control
);
winforms\Managed\System\WinForms\ButtonInternal\CheckBoxBaseAdapter.cs (1)
37
return ((CheckBox)base.
Control
);
winforms\Managed\System\WinForms\ButtonInternal\RadioButtonBaseAdapter.cs (1)
24
return ((RadioButton)base.
Control
);
winforms\Managed\System\WinForms\PropertyGridInternal\DropDownButton.cs (13)
157
if (
Control
.BackColor != SystemColors.Control && SystemInformation.HighContrast) {
159
Color c = ControlPaint.LightLight(
Control
.BackColor);
167
ControlPaint.DrawBorder(g, r, ControlPaint.Dark(
Control
.BackColor), ButtonBorderStyle.Solid);
172
Color c = ControlPaint.Light(
Control
.BackColor);
176
Control
.BackColor, 2, ButtonBorderStyle.Outset,
177
Control
.BackColor, 2, ButtonBorderStyle.Outset);
183
c = ControlPaint.LightLight(
Control
.BackColor);
191
ControlPaint.DrawBorder(g, r, ControlPaint.Dark(
Control
.BackColor), ButtonBorderStyle.Solid);
199
DDB_Draw3DBorder(pevent.Graphics,
Control
.ClientRectangle, true);
203
Rectangle rect =
Control
.ClientRectangle;
214
if (AccessibilityImprovements.Level3 && IsFilledWithHighlightColor && (
Control
.MouseIsOver ||
Control
.Focused)) {
218
ControlPaint.DrawImageReplaceColor(graphics, image, imageBounds, Color.Black,
Control
.ForeColor);