452 references to ControlPaint
System.Windows.Forms (193)
System\Windows\Forms\ComponentModel\COM2Interop\COM2FontConverter.cs (1)
54
_lastFont =
ControlPaint
.FontInPoints(font);
System\Windows\Forms\Control.cs (3)
886
if (
ControlPaint
.IsImageTransparent(BackgroundImage))
8054
bool imageIsTransparent =
ControlPaint
.IsImageTransparent(BackgroundImage);
8071
ControlPaint
.DrawBackgroundImage(
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.ColorOptions.cs (6)
50
colors.ButtonShadow =
ControlPaint
.Dark(_backColor);
51
colors.ButtonShadowDark =
ControlPaint
.DarkDark(_backColor);
52
colors.Highlight =
ControlPaint
.LightLight(_backColor);
56
colors.ButtonShadow =
ControlPaint
.Dark(_backColor);
57
colors.ButtonShadowDark =
ControlPaint
.LightLight(_backColor);
58
colors.Highlight =
ControlPaint
.LightLight(_backColor);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (6)
89
=>
ControlPaint
.CreateStringFormat(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic);
95
=>
ControlPaint
.CreateTextFormatFlags(Control, Control.TextAlign, Control.ShowToolTip, Control.UseMnemonic);
113
ControlPaint
.DrawBorderSimple(deviceContext, bounds,
ControlPaint
.Dark(Control.BackColor));
370
ControlPaint
.DrawFocusRectangle(g, r, Control.ForeColor, Control.BackColor);
407
ControlPaint
.DrawImageDisabled(graphics, image, imageBounds, unscaledImage: true);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (10)
96
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
101
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
102
ControlPaint
.DrawBorderSimple(e, r, colors.ButtonShadow);
110
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
184
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
189
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
190
ControlPaint
.DrawBorderSimple(e, r, colors.ButtonShadow);
198
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
278
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
283
ControlPaint
.DrawBorderSimple(e, r, colors.WindowFrame);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (2)
51
ControlPaint
.DrawBorderSimple(e, r, borderColor);
136
ControlPaint
.DrawBorderSimple(e, r, colors.Options.HighContrast ? colors.WindowText : GetContrastingBorderColor(colors.ButtonShadow));
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (3)
94
ControlPaint
.DrawBackgroundImage(
173
ControlPaint
.DrawHighContrastFocusRectangle(e.GraphicsInternal, layout.Focus, highlightTextColor);
202
ControlPaint
.DrawBorderSimple(e, r, colors.ButtonShadow);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (3)
198
ControlPaint
.DrawImageColorized(g, checkImage, fullSize, checkColor);
274
ControlPaint
.DrawMixedCheckBox(e.GraphicsInternal, layout.CheckBounds, style);
289
ControlPaint
.DrawCheckBox(e.GraphicsInternal, layout.CheckBounds, style);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
38
ControlPaint
.DrawBorderSimple(
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (2)
68
border =
ControlPaint
.ContrastControlDark;
215
ControlPaint
.DrawRadioButton(e.GraphicsInternal, check, style);
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (9)
81
ControlPaint
.DrawButton(graphics, bounds, ConvertToButtonState(state));
108
ControlPaint
.DrawButton(graphics, bounds, ConvertToButtonState(state));
119
ControlPaint
.DrawFocusRectangle(graphics, contentBounds);
157
ControlPaint
.DrawButton(g, bounds, ConvertToButtonState(state));
166
ControlPaint
.DrawFocusRectangle(g, contentBounds);
186
ControlPaint
.DrawButton(g, bounds, ConvertToButtonState(state));
193
ControlPaint
.DrawFocusRectangle(g, contentBounds);
265
ControlPaint
.DrawButton(graphics, bounds, ConvertToButtonState(state));
277
ControlPaint
.DrawFocusRectangle(graphics, contentBounds);
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (8)
61
ControlPaint
.DrawMixedCheckBox(g, glyphBounds, ConvertToButtonState(state));
65
ControlPaint
.DrawCheckBox(g, glyphBounds, ConvertToButtonState(state));
137
ControlPaint
.DrawMixedCheckBox(g, glyphBounds, ConvertToButtonState(state));
141
ControlPaint
.DrawCheckBox(g, glyphBounds, ConvertToButtonState(state));
151
ControlPaint
.DrawFocusRectangle(g, textBounds);
209
ControlPaint
.DrawMixedCheckBox(g, glyphBounds, ConvertToButtonState(state));
213
ControlPaint
.DrawCheckBox(g, glyphBounds, ConvertToButtonState(state));
223
ControlPaint
.DrawFocusRectangle(g, textBounds);
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (5)
83
ControlPaint
.DrawRadioButton(graphics, glyphBounds, ConvertToButtonState(state));
143
ControlPaint
.DrawRadioButton(g, glyphBounds, ConvertToButtonState(state));
151
ControlPaint
.DrawFocusRectangle(g, textBounds);
236
ControlPaint
.DrawRadioButton(g, glyphBounds, ConvertToButtonState(state));
244
ControlPaint
.DrawFocusRectangle(g, textBounds);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (6)
5680
ControlPaint
.FillReversibleRectangle(RectangleToScreen(rectInsertionBar), Color.White);
5710
HBRUSH halftone =
ControlPaint
.CreateHalftoneHBRUSH();
5729
HBRUSH halftone =
ControlPaint
.CreateHalftoneHBRUSH();
16699
ControlPaint
.DrawHighContrastFocusRectangle(g, GetGridFocusRectangle(), SystemColors.ActiveCaptionText);
16703
ControlPaint
.DrawFocusRectangle(g, GetGridFocusRectangle());
19308
ControlPaint
.DrawBorder3D(g, bounds, Border3DStyle.Sunken);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (5)
749
ControlPaint
.DrawBorder(
815
ControlPaint
.DrawBorder(
851
ControlPaint
.DrawBorderSimple(
890
ControlPaint
.DrawFocusRectangle(g, Rectangle.Inflate(valBounds, -1, -1), Color.Empty, cellStyle.ForeColor);
950
ControlPaint
.DrawFocusRectangle(
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (4)
1442
?
ControlPaint
.DarkDark(baseline)
1446
?
ControlPaint
.LightLight(baseline)
1452
?
ControlPaint
.Dark(baseline)
1456
?
ControlPaint
.Light(baseline)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (7)
1142
ControlPaint
.DrawFocusRectangle(g, valBounds, cellStyle.BackColor, cellStyle.ForeColor);
1250
ControlPaint
.DrawMixedCheckBox(
1260
ControlPaint
.DrawCheckBox(
1290
highlight =
ControlPaint
.LightLight(backBrushColor);
1367
ControlPaint
.DrawImageColorized(
1372
?
ControlPaint
.LightLight(foreBrushColor)
1517
ControlPaint
.DrawBorderSimple(g, layout.CheckBounds, colors.ButtonShadow);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.DataGridViewColumnHeaderCellRenderer.cs (1)
43
ControlPaint
.EnforceHeaderCellDividerContrast(g, bounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
2270
ControlPaint
.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor);
2281
ControlPaint
.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor);
2286
ControlPaint
.DrawFocusRectangle(g, textBounds, Color.Empty, cellStyle.ForeColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
897
ControlPaint
.DrawFocusRectangle(g, valBounds, Color.Empty, brushColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (3)
1003
ControlPaint
.DrawFocusRectangle(g, focusBounds, Color.Empty, brushColor);
1044
ControlPaint
.DrawFocusRectangle(g, errorBounds, Color.Empty, brushColor);
1059
ControlPaint
.DrawFocusRectangle(g, valBounds, Color.Empty, brushColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1197
ControlPaint
.DrawFocusRectangle(graphics, bounds, Color.Empty, backColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (2)
1042
ControlPaint
.IsDark(backColor))
1044
using Bitmap invertedBitmap =
ControlPaint
.CreateBitmapWithInvertedForeColor(bmp, backColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellRenderer.cs (1)
30
ControlPaint
.EnforceHeaderCellDividerContrast(g, bounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (1)
711
ControlPaint
.DrawFocusRectangle(graphics, valBounds, Color.Empty, cellStyle.ForeColor);
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (4)
494
ControlPaint
.DrawStringDisabled(graphics, Text, Font, backColor, textRectangle, format);
523
ControlPaint
.DrawStringDisabled(
592
using CreatePenScope hpenLight = new(
ControlPaint
.Light(backColor, 1.0f));
594
using CreatePenScope hpenDark = new(
ControlPaint
.Dark(backColor, 0f));
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (2)
249
using var light =
ControlPaint
.Light(backColor, 1.0f).GetCachedPenScope();
250
using var dark =
ControlPaint
.Dark(backColor, 0f).GetCachedPenScope();
System\Windows\Forms\Controls\ImageList\ImageList.cs (2)
374
HBITMAP hMask = (HBITMAP)
ControlPaint
.CreateHBitmapTransparencyMask(bitmap);
377
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, (IntPtr)hMask);
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (2)
158
HBITMAP hMask = (HBITMAP)
ControlPaint
.CreateHBitmapTransparencyMask(bitmap);
159
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, hMask);
System\Windows\Forms\Controls\Labels\Label.cs (5)
911
=>
ControlPaint
.CreateStringFormat(this, TextAlign, AutoEllipsis, UseMnemonic);
926
TextFormatFlags flags =
ControlPaint
.CreateTextFormatFlags(this, TextAlign, AutoEllipsis, UseMnemonic);
991
ControlPaint
.DrawImageDisabled(g, image, loc.X, loc.Y, BackColor);
1290
ControlPaint
.DrawStringDisabled(e.GraphicsInternal, Text, Font, color, face, stringFormat);
1357
ControlPaint
.PrintBorder(g, new Rectangle(Point.Empty, Size), BorderStyle, Border3DStyle.SunkenOuter);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (5)
138
s_iedisabledLinkColor =
ControlPaint
.Dark(DisabledColor);
1125
ControlPaint
.DrawStringDisabled(g, Text, Font, DisabledColor, ClientRectWithPadding, stringFormat);
1137
ControlPaint
.DrawStringDisabled(
1326
ControlPaint
.DrawFocusRectangle(g, Rectangle.Ceiling(focusRectangle), ForeColor, BackColor);
1332
ControlPaint
.DrawFocusRectangle(g, Rectangle.Ceiling(rect), ForeColor, BackColor);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (3)
565
ControlPaint
.DrawCheckBox(e.Graphics, box, state);
710
ControlPaint
.DrawBlackWhiteFocusRectangle(e.Graphics, textBounds, backColor);
734
ControlPaint
.DrawFocusRectangle(e.Graphics, emptyRectangle, foreColor, backColor);
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (1)
77
ControlPaint
.DrawFocusRectangle(Graphics, UpdateBounds(Bounds, drawText: false), Item.ForeColor, Item.BackColor);
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (1)
113
ControlPaint
.DrawFocusRectangle(Graphics, Rectangle.Inflate(bounds, -1, -1), Item.ForeColor, Item.BackColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (2)
1974
ControlPaint
.DrawReversibleLine(new Point(rc.X + i, rc.Y), new Point(rc.X + i, rc.Y + rc.Height), targetControl.BackColor);
1981
ControlPaint
.DrawReversibleLine(new Point(rc.X, rc.Y + i), new Point(rc.X + rc.Width, rc.Y + i), targetControl.BackColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CategoryGridEntry.cs (2)
125
ControlPaint
.DrawFocusRectangle(g, focusRect, SystemColors.ControlText, OwnerGrid.LineColor);
129
ControlPaint
.DrawFocusRectangle(g, focusRect);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.cs (1)
107
ControlPaint
.DrawFocusRectangle(pevent.Graphics, dropDownButtonRect, ForeColor, BackColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (13)
22
Color c =
ControlPaint
.LightLight(Control.BackColor);
23
ControlPaint
.DrawBorder(
32
ControlPaint
.DrawBorderSimple(e, r,
ControlPaint
.Dark(Control.BackColor));
39
Color c =
ControlPaint
.Light(Control.BackColor);
40
ControlPaint
.DrawBorder(
51
c =
ControlPaint
.LightLight(Control.BackColor);
52
ControlPaint
.DrawBorder(
61
ControlPaint
.DrawBorderSimple(e, r,
ControlPaint
.Dark(Control.BackColor));
78
ControlPaint
.DrawBorder(
91
if (
ControlPaint
.IsDark(backgroundColor) && image is Bitmap bitmap)
93
using Image invertedImage =
ControlPaint
.CreateBitmapWithInvertedForeColor(bitmap, Control.BackColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1723
ControlPaint
.InvertForeColorIfNeeded(bitmap, backgroundColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
2213
ControlPaint
.DrawFocusRectangle(g, new Rectangle(_offset2Units, _offset2Units, Size.Width - doubleOffset, Size.Height - doubleOffset));
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
240
ControlPaint
.DrawSizeGrip(glyphGraphics, BackColor, 0, 0, s_resizeGripSize, s_resizeGripSize);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStripButton.cs (1)
36
ControlPaint
.DrawBorder(graphics, bounds,
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
699
HBRUSH halftone =
ControlPaint
.CreateHalftoneHBRUSH();
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
628
ControlPaint
.DrawBackgroundImage(
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (4)
47
ControlPaint
.DrawFocusRectangle(g, contentBounds);
84
ControlPaint
.DrawFocusRectangle(g, contentBounds);
104
ControlPaint
.DrawFocusRectangle(g, contentBounds);
135
ControlPaint
.DrawFocusRectangle(g, contentBounds);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (1)
92
textFormat |=
ControlPaint
.ConvertAlignmentToTextFormat(alignment);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (2)
75
retFont =
ControlPaint
.FontInPoints(sysFont);
111
s_defaultFont =
ControlPaint
.FontInPoints(sysFont);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
711
ControlPaint
.DrawCaptionButton(g, new Rectangle(Point.Empty, image.Size), (CaptionButton)buttonToUse, ButtonState.Flat);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (7)
270
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, bounds, fillRect);
322
ControlPaint
.DrawBorder3D(e.Graphics, new Rectangle(0, 0, item.Width, item.Height), item.BorderStyle, (Border3DSide)item.BorderSides);
359
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, bounds, fillRect);
596
ControlPaint
.DrawBackgroundImage(
653
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, bounds, fillRect);
1114
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, bounds, fillRect);
1574
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, bounds, fillRect);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (3)
101
s_disabledImageColorMatrix =
ControlPaint
.MultiplyColorMatrix(transparency, greyscale);
837
if (
ControlPaint
.IsDark(backgroundColor))
839
Image invertedImage =
ControlPaint
.CreateBitmapWithInvertedForeColor(bitmap, e.Item.BackColor);
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (10)
255
ControlPaint
.DrawBorder3D(e.Graphics, bounds, Border3DStyle.Raised);
428
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, item.ContentRectangle, item.ContentRectangle);
473
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, item.ContentRectangle, fillRect);
499
ControlPaint
.DrawBorder3D(e.Graphics, new Rectangle(0, 0, item.Width - 1, item.Height - 1), item.BorderStyle, (Border3DSide)item.BorderSides);
567
ControlPaint
.DrawBackgroundImage(g, splitButton.BackgroundImage, splitButton.BackColor, splitButton.BackgroundImageLayout, fillRect, fillRect);
586
ControlPaint
.DrawBorderSimple(g, clientBounds, SystemColors.Highlight);
602
ControlPaint
.DrawBackgroundImage(g, splitButton.BackgroundImage, splitButton.BackColor, splitButton.BackgroundImageLayout, bounds, fillRect);
663
ControlPaint
.DrawBorderSimple(g, bounds, SystemColors.Highlight);
675
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, fillRect, fillRect);
797
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, fillRect, fillRect);
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2847
ControlPaint
.DrawFocusRectangle(g, bounds, color, SystemColors.Highlight);
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
585
ControlPaint
.DrawBorderSimple(e, editBounds, SystemColors.Control);
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (2)
305
ControlPaint
.DrawScrollButton(
311
ControlPaint
.DrawScrollButton(
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
470
_font =
ControlPaint
.FontInPoints(fontInWorldUnits);
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (1)
44
using HBITMAP mask = (HBITMAP)
ControlPaint
.CreateHBitmapTransparencyMask(bitmap);
System\Windows\Forms\Form.cs (1)
4415
ControlPaint
.DrawSizeGrip(
System\Windows\Forms\Layout\Containers\SplitContainer.cs (2)
1464
ControlPaint
.DrawFocusRectangle(g, r, ForeColor, BackColor);
1475
HBRUSH halftone =
ControlPaint
.CreateHalftoneHBRUSH();
System\Windows\Forms\Panels\Panel.cs (1)
234
ControlPaint
.PrintBorder(g, new Rectangle(Point.Empty, Size), BorderStyle, Border3DStyle.Sunken);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (4)
408
ControlPaint
.PaintTableCellBorder(cellBorderStyle, g, outsideCellBounds);
473
ControlPaint
.PaintTableCellBorder(cellBorderStyle, g, tableBounds);
476
ControlPaint
.PaintTableControlBorder(cellBorderStyle, g, displayRect);
480
ControlPaint
.PaintTableControlBorder(cellBorderStyle, g, displayRect);
System\Windows\Forms\Printing\PrintPreviewControl.cs (2)
726
ControlPaint
.DrawHighContrastFocusRectangle(e.Graphics, focusRect, SystemColors.ControlText);
730
ControlPaint
.DrawFocusRectangle(e.Graphics, focusRect);
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (1)
137
ControlPaint
.DrawFocusRectangle(GraphicsInternal, Bounds, ForeColor, BackColor);
System\Windows\Forms\Rendering\TextRenderer.cs (2)
558
return
ControlPaint
.IsDarker(backColor, SystemColors.Control)
559
?
ControlPaint
.Dark(backColor)
System\Windows\Forms\Scrolling\ScrollableControl.cs (2)
670
if (
ControlPaint
.IsImageTransparent(BackgroundImage))
675
ControlPaint
.DrawBackgroundImage(
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (1)
101
ControlPaint
.DrawBorder(Graphics, Bounds, SystemColors.WindowFrame, ButtonBorderStyle.Solid);
System.Windows.Forms.Design (35)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (2)
574
ControlPaint
.DrawButton(g, button, ButtonState.Normal);
591
ControlPaint
.DrawFocusRectangle(g, res);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (1)
155
ControlPaint
.DrawFocusRectangle(g, new Rectangle(2, 2, Width - 5, Height - 5));
System\Drawing\Design\ColorEditor.ColorPalette.cs (3)
383
ControlPaint
.DrawBorder(
394
ControlPaint
.DrawFocusRectangle(
401
ControlPaint
.DrawBorder(
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (4)
185
ControlPaint
.DrawBorder3D(e.Graphics, rc, Border3DStyle.Sunken);
201
ControlPaint
.DrawButton(e.Graphics, rc, ButtonState.Normal);
275
ControlPaint
.DrawFocusRectangle(e.Graphics, rc);
281
ControlPaint
.DrawFocusRectangle(e.Graphics, rc);
System\Windows\Forms\Design\ComponentTray.cs (1)
1210
ControlPaint
.DrawReversibleFrame(_mouseDragWorkspace, BackColor, FrameStyle.Dashed);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1020
ControlPaint
.DrawFocusRectangle(e.Graphics, focusRectangle, e.ForeColor, e.BackColor);
System\Windows\Forms\Design\DockEditor.DockUI.cs (1)
302
ControlPaint
.DrawButton(e.Graphics, rc, ButtonState.Pushed);
System\Windows\Forms\Design\GroupBoxDesigner.cs (1)
82
ControlPaint
.DrawGrid(pe.Graphics, rectangle, GridSize, control.BackColor);
System\Windows\Forms\Design\PanelDesigner.cs (2)
73
ControlPaint
.Light(Control.BackColor) :
74
ControlPaint
.Dark(Control.BackColor);
System\Windows\Forms\Design\ParentControlDesigner.cs (1)
2042
ControlPaint
.DrawGrid(pe.Graphics, paintRect, GridSize, control.BackColor);
System\Windows\Forms\Design\PictureBoxDesigner.cs (2)
40
penColor =
ControlPaint
.Light(ctl.BackColor);
44
penColor =
ControlPaint
.Dark(ctl.BackColor);
System\Windows\Forms\Design\SelectionUIService.ContainerSelectionUIItem.cs (1)
60
ControlPaint
.DrawContainerGrabHandle(graphics, glyphBounds);
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (10)
150
ControlPaint
.DrawSelectionFrame(graphics, false, outer, inner, borderColor);
155
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, (_sizes[0] != 0));
158
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, _sizes[2] != 0);
161
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, _sizes[7] != 0);
164
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, _sizes[5] != 0);
167
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, _sizes[6] != 0);
170
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, _sizes[1] != 0);
174
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, _sizes[3] != 0);
177
ControlPaint
.DrawGrabHandle(graphics, rect, fActive, _sizes[4] != 0);
181
ControlPaint
.DrawLockedFrame(graphics, outer, fActive);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
149
Color penColor = control.BackColor.GetBrightness() < .5 ?
ControlPaint
.Light(control.BackColor) :
ControlPaint
.Dark(control.BackColor);
System\Windows\Forms\Design\TabOrder.cs (1)
223
ControlPaint
.DrawSelectionFrame(graphics, active: false, ctlOuter, ctlInner, backColor);
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
47
ControlPaint
.Light(Control.BackColor) :
48
ControlPaint
.Dark(Control.BackColor);
System.Windows.Forms.Tests (224)
System\Windows\Forms\ControlPaintTests.cs (199)
34
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmap16Bit(bitmap, background);
59
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmap16Bit(bitmap, Color.Red);
82
Assert.Throws<ArgumentNullException>(() =>
ControlPaint
.CreateHBitmap16Bit(null, Color.Red));
105
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, monochromeMask);
137
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, (IntPtr)monochromeMask);
170
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, IntPtr.Zero);
193
Assert.Throws<ArgumentNullException>(() =>
ControlPaint
.CreateHBitmapColorMask(null, IntPtr.Zero));
213
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapTransparencyMask(bitmap);
238
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapTransparencyMask(bitmap);
261
Assert.Throws<ArgumentNullException>("bitmap", () =>
ControlPaint
.CreateHBitmapTransparencyMask(null));
277
using Bitmap invertedBitmap =
ControlPaint
.CreateBitmapWithInvertedForeColor(bitmap, Color.LightGray);
310
Assert.Equal(expected,
ControlPaint
.Dark(baseColor));
313
Assert.Equal(expected,
ControlPaint
.Dark(baseColor));
502
Assert.Equal(expected,
ControlPaint
.Dark(baseColor, percOfDarkDark));
505
Assert.Equal(expected,
ControlPaint
.Dark(baseColor, percOfDarkDark));
535
Assert.Equal(expected,
ControlPaint
.DarkDark(baseColor));
563
ControlPaint
.DrawBorder(graphics, bounds, color, style);
566
ControlPaint
.DrawBorder(graphics, bounds, color, style);
576
ControlPaint
.DrawBorder(graphics, new Rectangle(1, 2, 3, 4), Color.Red, style);
579
ControlPaint
.DrawBorder(graphics, new Rectangle(1, 2, 3, 4), Color.Red, style);
622
ControlPaint
.DrawBorder(graphics, bounds, leftColor, leftWidth, leftStyle, topColor, topWidth, topStyle, rightColor, rightWidth, rightStyle, bottomColor, bottomWidth, bottomStyle);
625
ControlPaint
.DrawBorder(graphics, bounds, leftColor, leftWidth, leftStyle, topColor, topWidth, topStyle, rightColor, rightWidth, rightStyle, bottomColor, bottomWidth, bottomStyle);
664
Assert.Throws<ArgumentOutOfRangeException>(() =>
ControlPaint
.DrawBorder(graphics, bounds, leftColor, leftWidth, leftStyle, topColor, topWidth, topStyle, rightColor, rightWidth, rightStyle, bottomColor, bottomWidth, bottomStyle));
675
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder(null, new Rectangle(1, 2, 3, 4), Color.Red, style));
683
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder(null, new Rectangle(1, 2, 3, 4), Color.Red, 1, style, Color.Red, 1, style, Color.Red, 1, style, Color.Red, 1, style));
702
ControlPaint
.DrawBorder3D(graphics, rectangle);
705
ControlPaint
.DrawBorder3D(graphics, rectangle);
727
ControlPaint
.DrawBorder3D(graphics, rectangle, style);
730
ControlPaint
.DrawBorder3D(graphics, rectangle, style);
755
ControlPaint
.DrawBorder3D(graphics, rectangle, style, side);
758
ControlPaint
.DrawBorder3D(graphics, rectangle, style, side);
767
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
770
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
779
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style);
782
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style);
791
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style, side);
794
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style, side);
802
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, new Rectangle(1, 2, 3, 4)));
803
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style));
804
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style, Border3DSide.All));
805
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, 1, 2, 3, 4));
806
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, 1, 2, 3, 4, style));
807
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, 1, 2, 3, 4, style, Border3DSide.All));
827
ControlPaint
.DrawButton(graphics, rectangle, state);
830
ControlPaint
.DrawButton(graphics, rectangle, state);
839
ControlPaint
.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
842
ControlPaint
.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
850
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawButton(null, new Rectangle(1, 2, 3, 4), state));
851
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawButton(null, 1, 2, 3, 4, state));
865
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawButton(graphics, new Rectangle(0, 0, width, height), state));
866
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawButton(graphics, 0, 0, width, height, state));
876
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawButton(graphics, new Rectangle(0, 0, -3, 4), state));
877
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawButton(graphics, 0, 0, -3, 4, state));
887
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawButton(graphics, new Rectangle(0, 0, 3, -4), state));
888
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawButton(graphics, 0, 0, 3, -4, state));
911
ControlPaint
.DrawCaptionButton(graphics, rectangle, button, state);
914
ControlPaint
.DrawCaptionButton(graphics, rectangle, button, state);
923
ControlPaint
.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
926
ControlPaint
.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
934
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCaptionButton(null, new Rectangle(1, 2, 3, 4), CaptionButton.Close, state));
935
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCaptionButton(null, 1, 2, 3, 4, CaptionButton.Close, state));
948
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCaptionButton(graphics, new Rectangle(0, 0, width, height), CaptionButton.Close, state));
949
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCaptionButton(graphics, 0, 0, width, height, CaptionButton.Close, state));
959
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawCaptionButton(graphics, new Rectangle(0, 0, -3, 4), CaptionButton.Close, state));
960
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawCaptionButton(graphics, 0, 0, -3, 4, CaptionButton.Close, state));
970
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawCaptionButton(graphics, new Rectangle(0, 0, 3, -4), CaptionButton.Close, state));
971
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawCaptionButton(graphics, 0, 0, 3, -4, CaptionButton.Close, state));
991
ControlPaint
.DrawCheckBox(graphics, rectangle, state);
994
ControlPaint
.DrawCheckBox(graphics, rectangle, state);
1003
ControlPaint
.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1006
ControlPaint
.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1014
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCheckBox(null, new Rectangle(1, 2, 3, 4), state));
1015
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCheckBox(null, 1, 2, 3, 4, state));
1029
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCheckBox(graphics, new Rectangle(0, 0, width, height), state));
1030
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCheckBox(graphics, 0, 0, width, height, state));
1040
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, new Rectangle(0, 0, -3, 4), state));
1041
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, 0, 0, -3, 4, state));
1051
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, new Rectangle(0, 0, 3, -4), state));
1052
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, 0, 0, 3, -4, state));
1072
ControlPaint
.DrawComboButton(graphics, rectangle, state);
1075
ControlPaint
.DrawComboButton(graphics, rectangle, state);
1084
ControlPaint
.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1087
ControlPaint
.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1095
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawComboButton(null, new Rectangle(1, 2, 3, 4), state));
1096
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawComboButton(null, 1, 2, 3, 4, state));
1109
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawComboButton(graphics, new Rectangle(0, 0, width, height), state));
1110
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawComboButton(graphics, 0, 0, width, height, state));
1120
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawComboButton(graphics, new Rectangle(0, 0, -3, 4), state));
1121
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawComboButton(graphics, 0, 0, -3, 4, state));
1131
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawComboButton(graphics, new Rectangle(0, 0, 3, -4), state));
1132
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawComboButton(graphics, 0, 0, 3, -4, state));
1151
ControlPaint
.DrawContainerGrabHandle(graphics, rectangle);
1154
ControlPaint
.DrawContainerGrabHandle(graphics, rectangle);
1160
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawContainerGrabHandle(null, new Rectangle(1, 2, 3, 4)));
1179
ControlPaint
.DrawFocusRectangle(graphics, rectangle);
1182
ControlPaint
.DrawFocusRectangle(graphics, rectangle);
1210
ControlPaint
.DrawFocusRectangle(graphics, rectangle, foreColor, backColor);
1213
ControlPaint
.DrawFocusRectangle(graphics, rectangle, foreColor, backColor);
1219
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4)));
1220
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4), Color.Red, Color.Blue));
1245
ControlPaint
.DrawGrabHandle(graphics, rectangle, primary, enabled);
1248
ControlPaint
.DrawGrabHandle(graphics, rectangle, primary, enabled);
1258
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawGrabHandle(null, new Rectangle(1, 2, 3, 4), primary, enabled));
1282
ControlPaint
.DrawGrid(graphics, area, pixelsBetweenDots, backColor);
1285
ControlPaint
.DrawGrid(graphics, area, pixelsBetweenDots, backColor);
1291
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawGrid(null, new Rectangle(1, 2, 3, 4), new Size(1, 1), Color.Red));
1303
Assert.Throws<ArgumentOutOfRangeException>("pixelsBetweenDots", () =>
ControlPaint
.DrawGrid(graphics, new Rectangle(0, 0, width, height), new Size(width, height), Color.Red));
1331
ControlPaint
.DrawImageDisabled(graphics, image, x, y, background);
1334
ControlPaint
.DrawImageDisabled(graphics, image, x, y, background);
1341
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawImageDisabled(null, image, 0, 0, Color.Red));
1349
Assert.Throws<NullReferenceException>(() =>
ControlPaint
.DrawImageDisabled(graphics, null, 0, 0, Color.Red));
1371
ControlPaint
.DrawLockedFrame(graphics, rectangle, primary);
1374
ControlPaint
.DrawLockedFrame(graphics, rectangle, primary);
1382
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawLockedFrame(null, new Rectangle(1, 2, 3, 4), primary));
1402
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph);
1405
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph);
1434
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph, foreColor, backColor);
1437
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph, foreColor, backColor);
1446
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph);
1449
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph);
1458
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph, foreColor, backColor);
1461
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph, foreColor, backColor);
1470
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMenuGlyph(null, new Rectangle(1, 2, 3, 4), glyph));
1471
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMenuGlyph(null, 1, 2, 3, 4, glyph));
1488
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMenuGlyph(graphics, new Rectangle(0, 0, width, height), glyph));
1489
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMenuGlyph(graphics, 0, 0, width, height, glyph));
1500
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMenuGlyph(graphics, new Rectangle(0, 0, -3, 4), glyph));
1501
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMenuGlyph(graphics, 0, 0, -3, 4, glyph));
1512
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMenuGlyph(graphics, new Rectangle(0, 0, 3, -4), glyph));
1513
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMenuGlyph(graphics, 0, 0, 3, -4, glyph));
1533
ControlPaint
.DrawMixedCheckBox(graphics, rectangle, state);
1536
ControlPaint
.DrawMixedCheckBox(graphics, rectangle, state);
1545
ControlPaint
.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1548
ControlPaint
.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1556
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMixedCheckBox(null, new Rectangle(1, 2, 3, 4), state));
1557
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMixedCheckBox(null, 1, 2, 3, 4, state));
1570
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMixedCheckBox(graphics, new Rectangle(0, 0, width, height), state));
1571
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMixedCheckBox(graphics, 0, 0, width, height, state));
1581
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMixedCheckBox(graphics, new Rectangle(0, 0, -3, 4), state));
1582
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMixedCheckBox(graphics, 0, 0, -3, 4, state));
1592
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMixedCheckBox(graphics, new Rectangle(0, 0, 3, -4), state));
1593
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMixedCheckBox(graphics, 0, 0, 3, -4, state));
1613
ControlPaint
.DrawRadioButton(graphics, rectangle, state);
1616
ControlPaint
.DrawRadioButton(graphics, rectangle, state);
1625
ControlPaint
.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1628
ControlPaint
.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1636
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawRadioButton(null, new Rectangle(1, 2, 3, 4), state));
1637
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawRadioButton(null, 1, 2, 3, 4, state));
1650
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawRadioButton(graphics, new Rectangle(0, 0, width, height), state));
1651
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawRadioButton(graphics, 0, 0, width, height, state));
1661
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawRadioButton(graphics, new Rectangle(0, 0, -3, 4), state));
1662
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawRadioButton(graphics, 0, 0, -3, 4, state));
1672
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawRadioButton(graphics, new Rectangle(0, 0, 3, -4), state));
1673
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawRadioButton(graphics, 0, 0, 3, -4, state));
1699
ControlPaint
.DrawReversibleFrame(rectangle, backColor, style);
1702
ControlPaint
.DrawReversibleFrame(rectangle, backColor, style);
1725
ControlPaint
.DrawReversibleLine(start, end, backColor);
1728
ControlPaint
.DrawReversibleLine(start, end, backColor);
1751
ControlPaint
.DrawScrollButton(graphics, rectangle, button, state);
1754
ControlPaint
.DrawScrollButton(graphics, rectangle, button, state);
1763
ControlPaint
.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
1766
ControlPaint
.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
1774
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawScrollButton(null, new Rectangle(1, 2, 3, 4), ScrollButton.Up, state));
1775
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawScrollButton(null, 1, 2, 3, 4, ScrollButton.Up, state));
1788
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawScrollButton(graphics, new Rectangle(0, 0, width, height), ScrollButton.Up, state));
1789
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawScrollButton(graphics, 0, 0, width, height, ScrollButton.Up, state));
1799
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawScrollButton(graphics, new Rectangle(0, 0, -3, 4), ScrollButton.Up, state));
1800
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawScrollButton(graphics, 0, 0, -3, 4, ScrollButton.Up, state));
1810
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawScrollButton(graphics, new Rectangle(0, 0, 3, -4), ScrollButton.Up, state));
1811
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawScrollButton(graphics, 0, 0, 3, -4, ScrollButton.Up, state));
1836
ControlPaint
.DrawSelectionFrame(graphics, active, outsideRect, insideRect, backColor);
1839
ControlPaint
.DrawSelectionFrame(graphics, active, outsideRect, insideRect, backColor);
1847
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawSelectionFrame(null, active, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), Color.Red));
1871
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle);
1874
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle);
1883
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
1886
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
1892
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawSizeGrip(null, Color.Red, new Rectangle(1, 2, 3, 4)));
1893
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawSizeGrip(null, Color.Red, 1, 2, 3, 4));
1919
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1922
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1931
ControlPaint
.DrawStringDisabled(graphics, s, null, Color.Red, new RectangleF(1, 2, 3, 4), null);
1934
ControlPaint
.DrawStringDisabled(graphics, s, null, Color.Red, new RectangleF(1, 2, 3, 4), null);
1941
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new RectangleF(1, 2, 3, 4), new StringFormat()));
1967
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1970
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1977
Assert.Throws<ArgumentNullException>("dc", () =>
ControlPaint
.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new Rectangle(1, 2, 3, 4), TextFormatFlags.Default));
1996
ControlPaint
.DrawVisualStyleBorder(graphics, rectangle);
1999
ControlPaint
.DrawVisualStyleBorder(graphics, rectangle);
2005
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawVisualStyleBorder(null, new Rectangle(1, 2, 3, 4)));
2026
ControlPaint
.FillReversibleRectangle(rectangle, backColor);
2029
ControlPaint
.FillReversibleRectangle(rectangle, backColor);
2042
bool result =
ControlPaint
.IsDark(color);
2074
Assert.Equal(expected,
ControlPaint
.Light(baseColor));
2077
Assert.Equal(expected,
ControlPaint
.Light(baseColor));
2266
Assert.Equal(expected,
ControlPaint
.Light(baseColor, percOfLightLight));
2269
Assert.Equal(expected,
ControlPaint
.Light(baseColor, percOfLightLight));
2299
Assert.Equal(expected,
ControlPaint
.LightLight(baseColor));
2302
Assert.Equal(expected,
ControlPaint
.LightLight(baseColor));
System\Windows\Forms\ControlPaintTests.Rendering.cs (25)
22
ControlPaint
.DrawBorder(graphics, bounds, Color.Blue, ButtonBorderStyle.Solid);
41
ControlPaint
.DrawBorder(graphics, bounds, Color.Gray, ButtonBorderStyle.Inset);
58
State.Pen(16,
ControlPaint
.DarkDark(Color.Gray), penStyle),
64
State.Pen(16,
ControlPaint
.DarkDark(Color.Gray), penStyle),
70
State.Pen(16,
ControlPaint
.LightLight(Color.Gray), penStyle),
76
State.Pen(16,
ControlPaint
.LightLight(Color.Gray), penStyle),
82
State.Pen(16,
ControlPaint
.Light(Color.Gray), penStyle),
88
State.Pen(16,
ControlPaint
.Light(Color.Gray), penStyle),
101
ControlPaint
.DrawBorder(graphics, bounds, SystemColors.Control, ButtonBorderStyle.Inset);
118
State.Pen(16,
ControlPaint
.DarkDark(SystemColors.Control), penStyle),
124
State.Pen(16,
ControlPaint
.DarkDark(SystemColors.Control), penStyle),
130
State.Pen(16,
ControlPaint
.LightLight(SystemColors.Control), penStyle),
136
State.Pen(16,
ControlPaint
.LightLight(SystemColors.Control), penStyle),
142
State.Pen(16,
ControlPaint
.Light(SystemColors.Control), penStyle),
148
State.Pen(16,
ControlPaint
.Light(SystemColors.Control), penStyle),
176
ControlPaint
.DrawBorder(graphics, bounds, Color.PeachPuff, ButtonBorderStyle.Outset);
195
State.Pen(16,
ControlPaint
.LightLight(Color.PeachPuff), penStyle),
201
State.Pen(16,
ControlPaint
.LightLight(Color.PeachPuff), penStyle),
207
State.Pen(16,
ControlPaint
.DarkDark(Color.PeachPuff), penStyle),
213
State.Pen(16,
ControlPaint
.DarkDark(Color.PeachPuff), penStyle),
231
State.Pen(16,
ControlPaint
.Dark(Color.PeachPuff), penStyle),
237
State.Pen(16,
ControlPaint
.Dark(Color.PeachPuff), penStyle),
250
ControlPaint
.DrawBorder(graphics, bounds, SystemColors.Control, ButtonBorderStyle.Outset);
324
ControlPaint
.DrawBorder(graphics, bounds, Color.Green, ButtonBorderStyle.Dotted);
352
ControlPaint
.DrawBorder(graphics, bounds, Color.Pink, ButtonBorderStyle.Dashed);