System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (9)
88/// Get <see cref="StringFormat"/> object for rendering text using GDI+ (<see cref="Graphics"/>).
99internal static void DrawDitheredFill(Graphics g, Color color1, Color color2, Rectangle bounds)
340Graphics g = e.GraphicsInternal;
368private void DrawFocus(Graphics g, Rectangle r)
376internal virtual void DrawImageCore(Graphics graphics, Image image, Rectangle imageBounds, Point imageStart, LayoutData layout)
436Graphics? graphics = deviceContext.TryGetGraphics(create: true);
460Graphics g = e.GraphicsInternal;
650internal static ColorOptions PaintFlatRender(Graphics g, Color foreColor, Color backColor, bool enabled) =>
656internal static ColorOptions PaintPopupRender(Graphics g, Color foreColor, Color backColor, bool enabled) =>
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\FlatButtonDarkModeRenderer.cs (4)
26Graphics graphics, Rectangle bounds, PushButtonState state, bool isDefault)
39public override void DrawFocusIndicator(Graphics g, Rectangle contentBounds, bool isDefault)
80private static void DrawButtonBorder(Graphics g, Rectangle bounds, PushButtonState state, bool isDefault)
97private static void DrawSingleBorder(Graphics g, Rectangle rect, Color color)
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (18)
53public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
65/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
66public static void DrawButton(Graphics g, Rectangle bounds, PushButtonState state) =>
78Graphics? graphics = deviceContext.TryGetGraphics(create: true);
105Graphics? graphics = deviceContext.TryGetGraphics(create: true);
116Graphics? graphics = deviceContext.TryGetGraphics(create: true);
124/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
125public static void DrawButton(Graphics g, Rectangle bounds, bool focused, PushButtonState state) =>
128/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
129public static void DrawButton(Graphics g, Rectangle bounds, string? buttonText, Font? font, bool focused, PushButtonState state)
141/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
142public static void DrawButton(Graphics g, Rectangle bounds, string? buttonText, Font? font, TextFormatFlags flags, bool focused, PushButtonState state)
170/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
172public static void DrawButton(Graphics g, Rectangle bounds, Image image, Rectangle imageBounds, bool focused, PushButtonState state)
197/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
199Graphics g,
221Graphics g,
246Graphics? graphics = deviceContext.TryGetGraphics(create: true);
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (13)
38/// <inheritdoc cref="ButtonRenderer.DrawParentBackground(Graphics, Rectangle, Control)"/>
39public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
49/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
50public static void DrawCheckBox(Graphics g, Point glyphLocation, CheckBoxState state)
83/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
85Graphics g,
101/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
103Graphics g,
113Graphics g,
155/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
157Graphics g,
181Graphics g,
230public static Size GetGlyphSize(Graphics g, CheckBoxState state) => GetGlyphSize((IDeviceContext)g, state);
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (15)
39/// <inheritdoc cref="ButtonRenderer.DrawParentBackground(Graphics, Rectangle, Control)"/>
40public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
49/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
50public static void DrawRadioButton(Graphics g, Point glyphLocation, RadioButtonState state) =>
65Graphics graphics,
87/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
89Graphics g,
102/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
104Graphics g,
117Graphics g,
155/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
157Graphics g,
181Graphics g,
204Graphics g,
251public static Size GetGlyphSize(Graphics g, RadioButtonState state)
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (7)
34private static void DrawBackground(Graphics g, Rectangle bounds, ComboBoxState state)
56public static void DrawTextBox(Graphics g, Rectangle bounds, ComboBoxState state)
66public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, ComboBoxState state)
74public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, ComboBoxState state)
82public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, TextFormatFlags flags, ComboBoxState state)
94public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
106public static void DrawDropDownButton(Graphics g, Rectangle bounds, ComboBoxState state)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (18)
1476protected virtual Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex) => Rectangle.Empty;
1537protected virtual Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex) => Rectangle.Empty;
2306Graphics graphics,
2312Graphics g,
2520Graphics graphics,
2534Graphics graphics,
2559Graphics graphics,
2605Graphics graphics,
2625Graphics graphics,
3069Graphics graphics,
3084Graphics graphics,
3121Graphics graphics,
3526Graphics graphics,
3546private static void PaintErrorIcon(Graphics graphics, Rectangle iconBounds)
3559Graphics graphics,
3591Graphics graphics,
3631internal void PaintWork(Graphics graphics,
3958internal static bool TextFitsInBounds(Graphics graphics, string text, Font font, Size maxBounds, TextFormatFlags flags)
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.DataGridViewComboBoxCellRenderer.cs (5)
30public static void DrawTextBox(Graphics g, Rectangle bounds, ComboBoxState state)
35public static void DrawDropDownButton(Graphics g, Rectangle bounds, ComboBoxState state)
41public static void DrawBorder(Graphics g, Rectangle bounds)
55public static void DrawDropDownButton(Graphics g, Rectangle bounds, ComboBoxState state, bool rightToLeft)
69public static void DrawReadOnlyButton(Graphics g, Rectangle bounds, ComboBoxState state)
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (6)
26protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
83protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
134protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize)
166Graphics graphics,
205Graphics graphics,
357Graphics graphics,
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (8)
50public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
62public static void DrawGroupBox(Graphics g, Rectangle bounds, GroupBoxState state)
77public static void DrawGroupBox(Graphics g, Rectangle bounds, string? groupBoxText, Font? font, GroupBoxState state)
84Graphics g,
96Graphics g,
126Graphics g,
157private static void DrawThemedGroupBoxNoText(Graphics g, Rectangle bounds, GroupBoxState state)
246private static void DrawUnthemedGroupBoxNoText(Graphics g, Rectangle bounds)
System\Windows\Forms\Controls\ImageList\ImageList.cs (5)
510public void Draw(Graphics g, Point pt, int index) => Draw(g, pt.X, pt.Y, index);
516public void Draw(Graphics g, int x, int y, int index) => Draw(g, x, y, _imageSize.Width, _imageSize.Height, index);
523public void Draw(Graphics g, int x, int y, int width, int height, int index)
661Graphics graphics = Graphics.FromImage(result);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (4)
15public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font)
18public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font, int width)
21public static SizeF MeasureTextSimple(PropertyGrid owner, Graphics g, string? text, Font font, SizeF size)
31public static SizeF MeasureText(PropertyGrid owner, Graphics g, string? text, Font font, SizeF size)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (11)
1181protected int GetLabelTextWidth(string? text, Graphics graphics, Font font)
1204public int GetValueTextWidth(string text, Graphics graphics, Font font)
1496/// Paints the label portion of this <see cref="GridEntry"/> into the given <see cref="Graphics"/> object.
1505Graphics g,
1622/// the given <see cref="Graphics"/> object.
1624private void PaintOutlineGlyph(Graphics g, Rectangle r)
1658void PaintOutlineWithExplorerTreeStyle(Graphics g, Rectangle r, HWND hwnd)
1699Graphics graphics,
1723void PaintOutlineWithClassicStyle(Graphics g, Rectangle r)
1775/// Paints the value portion of this <see cref="GridEntry"/> into the given <see cref="Graphics"/> object.
1783Graphics g,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (1)
501Graphics g,
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (9)
27public static void DrawTabItem(Graphics g, Rectangle bounds, TabItemState state)
37public static void DrawTabItem(Graphics g, Rectangle bounds, bool focused, TabItemState state)
54public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, TabItemState state)
62public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, bool focused, TabItemState state)
72public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, TextFormatFlags flags, bool focused, TabItemState state)
91public static void DrawTabItem(Graphics g, Rectangle bounds, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
111public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
121public static void DrawTabItem(Graphics g, Rectangle bounds, string? tabItemText, Font? font, TextFormatFlags flags, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
142public static void DrawTabPage(Graphics g, Rectangle bounds)
System\Windows\Forms\Controls\TextBox\TextBoxRenderer.cs (6)
25private static void DrawBackground(Graphics g, Rectangle bounds, TextBoxState state)
42public static void DrawTextBox(Graphics g, Rectangle bounds, TextBoxState state)
51public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, TextBoxState state)
59public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, Rectangle textBounds, TextBoxState state)
67public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, TextFormatFlags flags, TextBoxState state)
78public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, TextBoxState state)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (22)
157Graphics g = e.Graphics;
259Graphics g = e.Graphics;
346Graphics g = e.Graphics;
402Graphics g = e.Graphics;
482Graphics g = e.Graphics;
545Graphics g = e.Graphics;
910Graphics g = e.Graphics;
953private static void FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, int firstGradientWidth, int secondGradientWidth, LinearGradientMode mode, bool flipHorizontal)
1052Graphics g = e.Graphics;
1079private void RenderPressedGradient(Graphics g, Rectangle bounds)
1106Graphics g = e.Graphics;
1118private static void RenderBackgroundGradient(Graphics g, Control control, Color beginColor, Color endColor)
1124private static void RenderBackgroundGradient(Graphics g, Control control, Color beginColor, Color endColor, Orientation orientation)
1191Graphics g = e.Graphics;
1215Graphics g = e.Graphics;
1342Graphics g = e.Graphics;
1404private void RenderSelectedButtonFill(Graphics g, Rectangle bounds)
1428private void RenderCheckedButtonFill(Graphics g, Rectangle bounds)
1452private void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical)
1540private void RenderPressedButtonFill(Graphics g, Rectangle bounds)
1565Graphics g = e.Graphics;
1646private static Point RenderArrowInternal(Graphics g, Rectangle dropDownRect, ArrowDirection direction, Brush brush)
System\Windows\Forms\Controls\TrackBar\TrackBarRenderer.cs (14)
28public static void DrawHorizontalTrack(Graphics g, Rectangle bounds)
38public static void DrawVerticalTrack(Graphics g, Rectangle bounds)
48public static void DrawHorizontalThumb(Graphics g, Rectangle bounds, TrackBarThumbState state)
58public static void DrawVerticalThumb(Graphics g, Rectangle bounds, TrackBarThumbState state)
68public static void DrawLeftPointingThumb(Graphics g, Rectangle bounds, TrackBarThumbState state)
78public static void DrawRightPointingThumb(Graphics g, Rectangle bounds, TrackBarThumbState state)
88public static void DrawTopPointingThumb(Graphics g, Rectangle bounds, TrackBarThumbState state)
98public static void DrawBottomPointingThumb(Graphics g, Rectangle bounds, TrackBarThumbState state)
108public static void DrawHorizontalTicks(Graphics g, Rectangle bounds, int numTicks, EdgeStyle edgeStyle)
138public static void DrawVerticalTicks(Graphics g, Rectangle bounds, int numTicks, EdgeStyle edgeStyle)
168public static Size GetLeftPointingThumbSize(Graphics g, TrackBarThumbState state)
178public static Size GetRightPointingThumbSize(Graphics g, TrackBarThumbState state)
188public static Size GetTopPointingThumbSize(Graphics g, TrackBarThumbState state)
198public static Size GetBottomPointingThumbSize(Graphics g, TrackBarThumbState state)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutCellPaintEventArgs.cs (1)
15Graphics g,
System\Windows\Forms\Rendering\ControlPaint.cs (65)
249using Graphics graphics = dc.CreateGraphics();
419internal static void PrintBorder(Graphics graphics, Rectangle bounds, BorderStyle style, Border3DStyle b3dStyle)
440Graphics g,
546public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
573Graphics graphics,
751else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
810else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
874else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
948else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
1001public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
1011public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style)
1022public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides)
1028public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height)
1038public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style)
1048public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style, Border3DSide sides)
1080private static void DrawBorderComplex(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
1178Graphics? graphics = context.TryGetGraphics(create: true);
1204public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1210public static void DrawButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1225Graphics graphics,
1238Graphics graphics,
1252public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1258public static void DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1280public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1286public static void DrawComboButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1298public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds)
1342private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1363Graphics graphics,
1396using (Graphics g2 = Graphics.FromImage(bitmap))
1421public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
1428public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor)
1431internal static void DrawHighContrastFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1434internal static void DrawBlackWhiteFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1437private static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color color, bool highContrast, bool blackAndWhite = false)
1453Graphics graphics,
1466using Graphics g2 = Graphics.FromImage(bitmap);
1507public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled)
1534public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor)
1580Graphics graphics,
1604internal static void DrawImageReplaceColor(Graphics g, Image image, Rectangle dest, Color oldColor, Color newColor)
1617public static void DrawImageDisabled(Graphics graphics, Image image, int x, int y, Color background)
1624internal static void DrawImageDisabled(Graphics graphics, Image image, Rectangle imageBounds, bool unscaledImage)
1661using (Graphics g = Graphics.FromImage(bitmap))
1690internal static void EnforceHeaderCellDividerContrast(Graphics graphics, Rectangle bounds)
1707public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary)
1725public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph)
1733Graphics graphics,
1747public static void DrawMenuGlyph(Graphics graphics, int x, int y, int width, int height, MenuGlyph glyph)
1755Graphics graphics,
1770public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1773public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1787public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1793public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1869public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state)
1877Graphics graphics,
1928Graphics graphics,
1947public static void DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds)
1953public static void DrawSizeGrip(Graphics graphics, Color backColor, int x, int y, int width, int height)
2005Graphics graphics,
2081public static void DrawVisualStyleBorder(Graphics graphics, Rectangle bounds)
2381Graphics g,
2415internal static void PaintTableCellBorder(TableLayoutPanelCellBorderStyle borderStyle, Graphics g, Rectangle bound)
System\Windows\Forms\Rendering\ControlPaint_ModernControlButtonRenderer.cs (10)
22Graphics graphics,
142Graphics graphics,
223private static void DrawUpDownArrows(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
251private static void DrawLeftRightArrows(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
279private static void DrawEllipseSymbol(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
310private static void DrawOpenDropDownChevron(Graphics graphics, Brush brush, int centerX, int centerY, int size)
341private static void DrawUpArrow(Graphics graphics, Brush brush, int centerX, int centerY, int size)
353private static void DrawDownArrow(Graphics graphics, Brush brush, int centerX, int centerY, int size)
365private static void DrawLeftArrow(Graphics graphics, Brush brush, int centerX, int centerY, int size)
377private static void DrawRightArrow(Graphics graphics, Brush brush, int centerX, int centerY, int size)
System\Windows\Forms\Scrolling\ScrollBarRenderer.cs (12)
27public static void DrawArrowButton(Graphics g, Rectangle bounds, ScrollBarArrowButtonState state)
37public static void DrawHorizontalThumb(Graphics g, Rectangle bounds, ScrollBarState state)
47public static void DrawVerticalThumb(Graphics g, Rectangle bounds, ScrollBarState state)
57public static void DrawHorizontalThumbGrip(Graphics g, Rectangle bounds, ScrollBarState state)
67public static void DrawVerticalThumbGrip(Graphics g, Rectangle bounds, ScrollBarState state)
77public static void DrawRightHorizontalTrack(Graphics g, Rectangle bounds, ScrollBarState state)
87public static void DrawLeftHorizontalTrack(Graphics g, Rectangle bounds, ScrollBarState state)
97public static void DrawUpperVerticalTrack(Graphics g, Rectangle bounds, ScrollBarState state)
107public static void DrawLowerVerticalTrack(Graphics g, Rectangle bounds, ScrollBarState state)
117public static void DrawSizeBox(Graphics g, Rectangle bounds, ScrollBarSizeBoxState state)
127public static Size GetThumbGripSize(Graphics g, ScrollBarState state)
137public static Size GetSizeBoxSize(Graphics g, ScrollBarState state)