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