453 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)
885
if (
ControlPaint
.IsImageTransparent(BackgroundImage))
8093
bool imageIsTransparent =
ControlPaint
.IsImageTransparent(BackgroundImage);
8110
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)
5677
ControlPaint
.FillReversibleRectangle(RectangleToScreen(rectInsertionBar), Color.White);
5707
HBRUSH halftone =
ControlPaint
.CreateHalftoneHBRUSH();
5726
HBRUSH halftone =
ControlPaint
.CreateHalftoneHBRUSH();
16715
ControlPaint
.DrawHighContrastFocusRectangle(g, GetGridFocusRectangle(), SystemColors.ActiveCaptionText);
16719
ControlPaint
.DrawFocusRectangle(g, GetGridFocusRectangle());
19324
ControlPaint
.DrawBorder3D(g, bounds, Border3DStyle.Sunken);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (5)
746
ControlPaint
.DrawBorder(
812
ControlPaint
.DrawBorder(
848
ControlPaint
.DrawBorderSimple(
887
ControlPaint
.DrawFocusRectangle(g, Rectangle.Inflate(valBounds, -1, -1), Color.Empty, cellStyle.ForeColor);
947
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)
1151
ControlPaint
.DrawFocusRectangle(g, valBounds, cellStyle.BackColor, cellStyle.ForeColor);
1259
ControlPaint
.DrawMixedCheckBox(
1269
ControlPaint
.DrawCheckBox(
1299
highlight =
ControlPaint
.LightLight(backBrushColor);
1376
ControlPaint
.DrawImageColorized(
1381
?
ControlPaint
.LightLight(foreBrushColor)
1526
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)
2263
ControlPaint
.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor);
2274
ControlPaint
.DrawFocusRectangle(g, focusBounds, Color.Empty, cellStyle.ForeColor);
2279
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)
1000
ControlPaint
.DrawFocusRectangle(g, focusBounds, Color.Empty, brushColor);
1041
ControlPaint
.DrawFocusRectangle(g, errorBounds, Color.Empty, brushColor);
1056
ControlPaint
.DrawFocusRectangle(g, valBounds, Color.Empty, brushColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1201
ControlPaint
.DrawFocusRectangle(graphics, bounds, Color.Empty, backColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (2)
1046
ControlPaint
.IsDark(backColor))
1048
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)
713
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)
74
retFont =
ControlPaint
.FontInPoints(sysFont);
110
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);
836
if (
ControlPaint
.IsDark(backgroundColor))
838
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);
565
ControlPaint
.DrawBackgroundImage(g, splitButton.BackgroundImage, splitButton.BackColor, splitButton.BackgroundImageLayout, fillRect, fillRect);
583
ControlPaint
.DrawBorderSimple(g, clientBounds, SystemColors.Highlight);
601
ControlPaint
.DrawBackgroundImage(g, splitButton.BackgroundImage, splitButton.BackColor, splitButton.BackgroundImageLayout, bounds, fillRect);
662
ControlPaint
.DrawBorderSimple(g, bounds, SystemColors.Highlight);
674
ControlPaint
.DrawBackgroundImage(g, item.BackgroundImage, item.BackColor, item.BackgroundImageLayout, fillRect, fillRect);
796
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)
664
if (
ControlPaint
.IsImageTransparent(BackgroundImage))
669
ControlPaint
.DrawBackgroundImage(
System\Windows\Forms\ToolTip\DrawToolTipEventArgs.cs (1)
101
ControlPaint
.DrawBorder(Graphics, Bounds, SystemColors.WindowFrame, ButtonBorderStyle.Solid);
System.Windows.Forms.Design (36)
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)
1018
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)
2043
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\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
792
ControlPaint
.DrawFocusRectangle(e.Graphics, fillBounds, e.ForeColor, e.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)
36
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmap16Bit(bitmap, background);
61
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmap16Bit(bitmap, Color.Red);
84
Assert.Throws<ArgumentNullException>(() =>
ControlPaint
.CreateHBitmap16Bit(null, Color.Red));
107
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, monochromeMask);
139
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, (IntPtr)monochromeMask);
172
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapColorMask(bitmap, IntPtr.Zero);
195
Assert.Throws<ArgumentNullException>(() =>
ControlPaint
.CreateHBitmapColorMask(null, IntPtr.Zero));
215
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapTransparencyMask(bitmap);
240
HBITMAP hBitmap = (HBITMAP)
ControlPaint
.CreateHBitmapTransparencyMask(bitmap);
263
Assert.Throws<ArgumentNullException>("bitmap", () =>
ControlPaint
.CreateHBitmapTransparencyMask(null));
279
using Bitmap invertedBitmap =
ControlPaint
.CreateBitmapWithInvertedForeColor(bitmap, Color.LightGray);
312
Assert.Equal(expected,
ControlPaint
.Dark(baseColor));
315
Assert.Equal(expected,
ControlPaint
.Dark(baseColor));
504
Assert.Equal(expected,
ControlPaint
.Dark(baseColor, percOfDarkDark));
507
Assert.Equal(expected,
ControlPaint
.Dark(baseColor, percOfDarkDark));
537
Assert.Equal(expected,
ControlPaint
.DarkDark(baseColor));
565
ControlPaint
.DrawBorder(graphics, bounds, color, style);
568
ControlPaint
.DrawBorder(graphics, bounds, color, style);
578
ControlPaint
.DrawBorder(graphics, new Rectangle(1, 2, 3, 4), Color.Red, style);
581
ControlPaint
.DrawBorder(graphics, new Rectangle(1, 2, 3, 4), Color.Red, style);
624
ControlPaint
.DrawBorder(graphics, bounds, leftColor, leftWidth, leftStyle, topColor, topWidth, topStyle, rightColor, rightWidth, rightStyle, bottomColor, bottomWidth, bottomStyle);
627
ControlPaint
.DrawBorder(graphics, bounds, leftColor, leftWidth, leftStyle, topColor, topWidth, topStyle, rightColor, rightWidth, rightStyle, bottomColor, bottomWidth, bottomStyle);
666
Assert.Throws<ArgumentOutOfRangeException>(() =>
ControlPaint
.DrawBorder(graphics, bounds, leftColor, leftWidth, leftStyle, topColor, topWidth, topStyle, rightColor, rightWidth, rightStyle, bottomColor, bottomWidth, bottomStyle));
677
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder(null, new Rectangle(1, 2, 3, 4), Color.Red, style));
685
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));
704
ControlPaint
.DrawBorder3D(graphics, rectangle);
707
ControlPaint
.DrawBorder3D(graphics, rectangle);
729
ControlPaint
.DrawBorder3D(graphics, rectangle, style);
732
ControlPaint
.DrawBorder3D(graphics, rectangle, style);
757
ControlPaint
.DrawBorder3D(graphics, rectangle, style, side);
760
ControlPaint
.DrawBorder3D(graphics, rectangle, style, side);
769
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
772
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
781
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style);
784
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style);
793
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style, side);
796
ControlPaint
.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style, side);
804
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, new Rectangle(1, 2, 3, 4)));
805
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style));
806
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, new Rectangle(1, 2, 3, 4), style, Border3DSide.All));
807
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, 1, 2, 3, 4));
808
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, 1, 2, 3, 4, style));
809
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawBorder3D(null, 1, 2, 3, 4, style, Border3DSide.All));
829
ControlPaint
.DrawButton(graphics, rectangle, state);
832
ControlPaint
.DrawButton(graphics, rectangle, state);
841
ControlPaint
.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
844
ControlPaint
.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
852
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawButton(null, new Rectangle(1, 2, 3, 4), state));
853
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawButton(null, 1, 2, 3, 4, state));
867
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawButton(graphics, new Rectangle(0, 0, width, height), state));
868
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawButton(graphics, 0, 0, width, height, state));
878
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawButton(graphics, new Rectangle(0, 0, -3, 4), state));
879
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawButton(graphics, 0, 0, -3, 4, state));
889
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawButton(graphics, new Rectangle(0, 0, 3, -4), state));
890
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawButton(graphics, 0, 0, 3, -4, state));
913
ControlPaint
.DrawCaptionButton(graphics, rectangle, button, state);
916
ControlPaint
.DrawCaptionButton(graphics, rectangle, button, state);
925
ControlPaint
.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
928
ControlPaint
.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
936
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCaptionButton(null, new Rectangle(1, 2, 3, 4), CaptionButton.Close, state));
937
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCaptionButton(null, 1, 2, 3, 4, CaptionButton.Close, state));
950
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCaptionButton(graphics, new Rectangle(0, 0, width, height), CaptionButton.Close, state));
951
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCaptionButton(graphics, 0, 0, width, height, CaptionButton.Close, state));
961
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawCaptionButton(graphics, new Rectangle(0, 0, -3, 4), CaptionButton.Close, state));
962
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawCaptionButton(graphics, 0, 0, -3, 4, CaptionButton.Close, state));
972
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawCaptionButton(graphics, new Rectangle(0, 0, 3, -4), CaptionButton.Close, state));
973
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawCaptionButton(graphics, 0, 0, 3, -4, CaptionButton.Close, state));
993
ControlPaint
.DrawCheckBox(graphics, rectangle, state);
996
ControlPaint
.DrawCheckBox(graphics, rectangle, state);
1005
ControlPaint
.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1008
ControlPaint
.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1016
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCheckBox(null, new Rectangle(1, 2, 3, 4), state));
1017
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawCheckBox(null, 1, 2, 3, 4, state));
1031
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCheckBox(graphics, new Rectangle(0, 0, width, height), state));
1032
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawCheckBox(graphics, 0, 0, width, height, state));
1042
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, new Rectangle(0, 0, -3, 4), state));
1043
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, 0, 0, -3, 4, state));
1053
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, new Rectangle(0, 0, 3, -4), state));
1054
Assert.Throws<ArgumentOutOfRangeException>(expectedParamName, () =>
ControlPaint
.DrawCheckBox(graphics, 0, 0, 3, -4, state));
1074
ControlPaint
.DrawComboButton(graphics, rectangle, state);
1077
ControlPaint
.DrawComboButton(graphics, rectangle, state);
1086
ControlPaint
.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1089
ControlPaint
.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1097
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawComboButton(null, new Rectangle(1, 2, 3, 4), state));
1098
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawComboButton(null, 1, 2, 3, 4, state));
1111
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawComboButton(graphics, new Rectangle(0, 0, width, height), state));
1112
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawComboButton(graphics, 0, 0, width, height, state));
1122
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawComboButton(graphics, new Rectangle(0, 0, -3, 4), state));
1123
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawComboButton(graphics, 0, 0, -3, 4, state));
1133
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawComboButton(graphics, new Rectangle(0, 0, 3, -4), state));
1134
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawComboButton(graphics, 0, 0, 3, -4, state));
1153
ControlPaint
.DrawContainerGrabHandle(graphics, rectangle);
1156
ControlPaint
.DrawContainerGrabHandle(graphics, rectangle);
1162
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawContainerGrabHandle(null, new Rectangle(1, 2, 3, 4)));
1181
ControlPaint
.DrawFocusRectangle(graphics, rectangle);
1184
ControlPaint
.DrawFocusRectangle(graphics, rectangle);
1212
ControlPaint
.DrawFocusRectangle(graphics, rectangle, foreColor, backColor);
1215
ControlPaint
.DrawFocusRectangle(graphics, rectangle, foreColor, backColor);
1221
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4)));
1222
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawFocusRectangle(null, new Rectangle(1, 2, 3, 4), Color.Red, Color.Blue));
1247
ControlPaint
.DrawGrabHandle(graphics, rectangle, primary, enabled);
1250
ControlPaint
.DrawGrabHandle(graphics, rectangle, primary, enabled);
1260
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawGrabHandle(null, new Rectangle(1, 2, 3, 4), primary, enabled));
1284
ControlPaint
.DrawGrid(graphics, area, pixelsBetweenDots, backColor);
1287
ControlPaint
.DrawGrid(graphics, area, pixelsBetweenDots, backColor);
1293
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawGrid(null, new Rectangle(1, 2, 3, 4), new Size(1, 1), Color.Red));
1305
Assert.Throws<ArgumentOutOfRangeException>("pixelsBetweenDots", () =>
ControlPaint
.DrawGrid(graphics, new Rectangle(0, 0, width, height), new Size(width, height), Color.Red));
1333
ControlPaint
.DrawImageDisabled(graphics, image, x, y, background);
1336
ControlPaint
.DrawImageDisabled(graphics, image, x, y, background);
1343
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawImageDisabled(null, image, 0, 0, Color.Red));
1351
Assert.Throws<NullReferenceException>(() =>
ControlPaint
.DrawImageDisabled(graphics, null, 0, 0, Color.Red));
1373
ControlPaint
.DrawLockedFrame(graphics, rectangle, primary);
1376
ControlPaint
.DrawLockedFrame(graphics, rectangle, primary);
1384
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawLockedFrame(null, new Rectangle(1, 2, 3, 4), primary));
1404
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph);
1407
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph);
1436
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph, foreColor, backColor);
1439
ControlPaint
.DrawMenuGlyph(graphics, rectangle, glyph, foreColor, backColor);
1448
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph);
1451
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph);
1460
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph, foreColor, backColor);
1463
ControlPaint
.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph, foreColor, backColor);
1472
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMenuGlyph(null, new Rectangle(1, 2, 3, 4), glyph));
1473
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMenuGlyph(null, 1, 2, 3, 4, glyph));
1490
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMenuGlyph(graphics, new Rectangle(0, 0, width, height), glyph));
1491
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMenuGlyph(graphics, 0, 0, width, height, glyph));
1502
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMenuGlyph(graphics, new Rectangle(0, 0, -3, 4), glyph));
1503
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMenuGlyph(graphics, 0, 0, -3, 4, glyph));
1514
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMenuGlyph(graphics, new Rectangle(0, 0, 3, -4), glyph));
1515
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMenuGlyph(graphics, 0, 0, 3, -4, glyph));
1535
ControlPaint
.DrawMixedCheckBox(graphics, rectangle, state);
1538
ControlPaint
.DrawMixedCheckBox(graphics, rectangle, state);
1547
ControlPaint
.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1550
ControlPaint
.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1558
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMixedCheckBox(null, new Rectangle(1, 2, 3, 4), state));
1559
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawMixedCheckBox(null, 1, 2, 3, 4, state));
1572
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMixedCheckBox(graphics, new Rectangle(0, 0, width, height), state));
1573
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawMixedCheckBox(graphics, 0, 0, width, height, state));
1583
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMixedCheckBox(graphics, new Rectangle(0, 0, -3, 4), state));
1584
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawMixedCheckBox(graphics, 0, 0, -3, 4, state));
1594
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMixedCheckBox(graphics, new Rectangle(0, 0, 3, -4), state));
1595
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawMixedCheckBox(graphics, 0, 0, 3, -4, state));
1615
ControlPaint
.DrawRadioButton(graphics, rectangle, state);
1618
ControlPaint
.DrawRadioButton(graphics, rectangle, state);
1627
ControlPaint
.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1630
ControlPaint
.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state);
1638
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawRadioButton(null, new Rectangle(1, 2, 3, 4), state));
1639
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawRadioButton(null, 1, 2, 3, 4, state));
1652
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawRadioButton(graphics, new Rectangle(0, 0, width, height), state));
1653
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawRadioButton(graphics, 0, 0, width, height, state));
1663
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawRadioButton(graphics, new Rectangle(0, 0, -3, 4), state));
1664
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawRadioButton(graphics, 0, 0, -3, 4, state));
1674
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawRadioButton(graphics, new Rectangle(0, 0, 3, -4), state));
1675
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawRadioButton(graphics, 0, 0, 3, -4, state));
1701
ControlPaint
.DrawReversibleFrame(rectangle, backColor, style);
1704
ControlPaint
.DrawReversibleFrame(rectangle, backColor, style);
1727
ControlPaint
.DrawReversibleLine(start, end, backColor);
1730
ControlPaint
.DrawReversibleLine(start, end, backColor);
1753
ControlPaint
.DrawScrollButton(graphics, rectangle, button, state);
1756
ControlPaint
.DrawScrollButton(graphics, rectangle, button, state);
1765
ControlPaint
.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
1768
ControlPaint
.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state);
1776
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawScrollButton(null, new Rectangle(1, 2, 3, 4), ScrollButton.Up, state));
1777
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawScrollButton(null, 1, 2, 3, 4, ScrollButton.Up, state));
1790
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawScrollButton(graphics, new Rectangle(0, 0, width, height), ScrollButton.Up, state));
1791
Assert.Throws<ArgumentException>(() =>
ControlPaint
.DrawScrollButton(graphics, 0, 0, width, height, ScrollButton.Up, state));
1801
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawScrollButton(graphics, new Rectangle(0, 0, -3, 4), ScrollButton.Up, state));
1802
Assert.Throws<ArgumentOutOfRangeException>("width", () =>
ControlPaint
.DrawScrollButton(graphics, 0, 0, -3, 4, ScrollButton.Up, state));
1812
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawScrollButton(graphics, new Rectangle(0, 0, 3, -4), ScrollButton.Up, state));
1813
Assert.Throws<ArgumentOutOfRangeException>("height", () =>
ControlPaint
.DrawScrollButton(graphics, 0, 0, 3, -4, ScrollButton.Up, state));
1838
ControlPaint
.DrawSelectionFrame(graphics, active, outsideRect, insideRect, backColor);
1841
ControlPaint
.DrawSelectionFrame(graphics, active, outsideRect, insideRect, backColor);
1849
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawSelectionFrame(null, active, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), Color.Red));
1873
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle);
1876
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle);
1885
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
1888
ControlPaint
.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
1894
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawSizeGrip(null, Color.Red, new Rectangle(1, 2, 3, 4)));
1895
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawSizeGrip(null, Color.Red, 1, 2, 3, 4));
1921
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1924
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1933
ControlPaint
.DrawStringDisabled(graphics, s, null, Color.Red, new RectangleF(1, 2, 3, 4), null);
1936
ControlPaint
.DrawStringDisabled(graphics, s, null, Color.Red, new RectangleF(1, 2, 3, 4), null);
1943
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new RectangleF(1, 2, 3, 4), new StringFormat()));
1969
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1972
ControlPaint
.DrawStringDisabled(graphics, s, font, color, layoutRectangle, format);
1979
Assert.Throws<ArgumentNullException>("dc", () =>
ControlPaint
.DrawStringDisabled(null, s, SystemFonts.MenuFont, Color.Red, new Rectangle(1, 2, 3, 4), TextFormatFlags.Default));
1998
ControlPaint
.DrawVisualStyleBorder(graphics, rectangle);
2001
ControlPaint
.DrawVisualStyleBorder(graphics, rectangle);
2007
Assert.Throws<ArgumentNullException>("graphics", () =>
ControlPaint
.DrawVisualStyleBorder(null, new Rectangle(1, 2, 3, 4)));
2028
ControlPaint
.FillReversibleRectangle(rectangle, backColor);
2031
ControlPaint
.FillReversibleRectangle(rectangle, backColor);
2044
bool result =
ControlPaint
.IsDark(color);
2076
Assert.Equal(expected,
ControlPaint
.Light(baseColor));
2079
Assert.Equal(expected,
ControlPaint
.Light(baseColor));
2268
Assert.Equal(expected,
ControlPaint
.Light(baseColor, percOfLightLight));
2271
Assert.Equal(expected,
ControlPaint
.Light(baseColor, percOfLightLight));
2301
Assert.Equal(expected,
ControlPaint
.LightLight(baseColor));
2304
Assert.Equal(expected,
ControlPaint
.LightLight(baseColor));
System\Windows\Forms\ControlPaintTests.Rendering.cs (25)
24
ControlPaint
.DrawBorder(graphics, bounds, Color.Blue, ButtonBorderStyle.Solid);
43
ControlPaint
.DrawBorder(graphics, bounds, Color.Gray, ButtonBorderStyle.Inset);
60
State.Pen(16,
ControlPaint
.DarkDark(Color.Gray), penStyle),
66
State.Pen(16,
ControlPaint
.DarkDark(Color.Gray), penStyle),
72
State.Pen(16,
ControlPaint
.LightLight(Color.Gray), penStyle),
78
State.Pen(16,
ControlPaint
.LightLight(Color.Gray), penStyle),
84
State.Pen(16,
ControlPaint
.Light(Color.Gray), penStyle),
90
State.Pen(16,
ControlPaint
.Light(Color.Gray), penStyle),
103
ControlPaint
.DrawBorder(graphics, bounds, SystemColors.Control, ButtonBorderStyle.Inset);
120
State.Pen(16,
ControlPaint
.DarkDark(SystemColors.Control), penStyle),
126
State.Pen(16,
ControlPaint
.DarkDark(SystemColors.Control), penStyle),
132
State.Pen(16,
ControlPaint
.LightLight(SystemColors.Control), penStyle),
138
State.Pen(16,
ControlPaint
.LightLight(SystemColors.Control), penStyle),
144
State.Pen(16,
ControlPaint
.Light(SystemColors.Control), penStyle),
150
State.Pen(16,
ControlPaint
.Light(SystemColors.Control), penStyle),
178
ControlPaint
.DrawBorder(graphics, bounds, Color.PeachPuff, ButtonBorderStyle.Outset);
197
State.Pen(16,
ControlPaint
.LightLight(Color.PeachPuff), penStyle),
203
State.Pen(16,
ControlPaint
.LightLight(Color.PeachPuff), penStyle),
209
State.Pen(16,
ControlPaint
.DarkDark(Color.PeachPuff), penStyle),
215
State.Pen(16,
ControlPaint
.DarkDark(Color.PeachPuff), penStyle),
233
State.Pen(16,
ControlPaint
.Dark(Color.PeachPuff), penStyle),
239
State.Pen(16,
ControlPaint
.Dark(Color.PeachPuff), penStyle),
252
ControlPaint
.DrawBorder(graphics, bounds, SystemColors.Control, ButtonBorderStyle.Outset);
326
ControlPaint
.DrawBorder(graphics, bounds, Color.Green, ButtonBorderStyle.Dotted);
354
ControlPaint
.DrawBorder(graphics, bounds, Color.Pink, ButtonBorderStyle.Dashed);