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