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;
665internal static ColorOptions PaintFlatRender(Graphics g, Color foreColor, Color backColor, bool enabled) =>
671internal 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)
30private static void DrawBackground(Graphics g, Rectangle bounds, ComboBoxState state)
52public static void DrawTextBox(Graphics g, Rectangle bounds, ComboBoxState state)
62public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, ComboBoxState state)
70public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, ComboBoxState state)
78public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, TextFormatFlags flags, ComboBoxState state)
90public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
102public 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)
1178protected int GetLabelTextWidth(string? text, Graphics graphics, Font font)
1201public int GetValueTextWidth(string text, Graphics graphics, Font font)
1493/// Paints the label portion of this <see cref="GridEntry"/> into the given <see cref="Graphics"/> object.
1502Graphics g,
1619/// the given <see cref="Graphics"/> object.
1621private void PaintOutlineGlyph(Graphics g, Rectangle r)
1655void PaintOutlineWithExplorerTreeStyle(Graphics g, Rectangle r, HWND hwnd)
1696Graphics graphics,
1720void PaintOutlineWithClassicStyle(Graphics g, Rectangle r)
1772/// Paints the value portion of this <see cref="GridEntry"/> into the given <see cref="Graphics"/> object.
1780Graphics 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;
345Graphics g = e.Graphics;
401Graphics g = e.Graphics;
481Graphics g = e.Graphics;
544Graphics g = e.Graphics;
909Graphics g = e.Graphics;
952private static void FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, int firstGradientWidth, int secondGradientWidth, LinearGradientMode mode, bool flipHorizontal)
1051Graphics g = e.Graphics;
1078private void RenderPressedGradient(Graphics g, Rectangle bounds)
1105Graphics g = e.Graphics;
1117private static void RenderBackgroundGradient(Graphics g, Control control, Color beginColor, Color endColor)
1123private static void RenderBackgroundGradient(Graphics g, Control control, Color beginColor, Color endColor, Orientation orientation)
1190Graphics g = e.Graphics;
1214Graphics g = e.Graphics;
1341Graphics g = e.Graphics;
1403private void RenderSelectedButtonFill(Graphics g, Rectangle bounds)
1427private void RenderCheckedButtonFill(Graphics g, Rectangle bounds)
1451private void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical)
1539private void RenderPressedButtonFill(Graphics g, Rectangle bounds)
1564Graphics g = e.Graphics;
1645private 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,
553public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
580Graphics graphics,
758else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
817else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
881else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
955else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
1008public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
1018public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style)
1029public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides)
1035public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height)
1045public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style)
1055public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style, Border3DSide sides)
1087private static void DrawBorderComplex(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
1185Graphics? graphics = context.TryGetGraphics(create: true);
1211public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1217public static void DrawButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1232Graphics graphics,
1245Graphics graphics,
1259public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1265public static void DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1287public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1293public static void DrawComboButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1305public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds)
1349private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1370Graphics graphics,
1400using (Graphics g2 = Graphics.FromImage(bitmap))
1425public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
1432public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor)
1435internal static void DrawHighContrastFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1438internal static void DrawBlackWhiteFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1441private static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color color, bool highContrast, bool blackAndWhite = false)
1457Graphics graphics,
1470using Graphics g2 = Graphics.FromImage(bitmap);
1511public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled)
1538public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor)
1581Graphics graphics,
1605internal static void DrawImageReplaceColor(Graphics g, Image image, Rectangle dest, Color oldColor, Color newColor)
1618public static void DrawImageDisabled(Graphics graphics, Image image, int x, int y, Color background)
1625internal static void DrawImageDisabled(Graphics graphics, Image image, Rectangle imageBounds, bool unscaledImage)
1662using (Graphics g = Graphics.FromImage(bitmap))
1691internal static void EnforceHeaderCellDividerContrast(Graphics graphics, Rectangle bounds)
1708public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary)
1726public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph)
1734Graphics graphics,
1748public static void DrawMenuGlyph(Graphics graphics, int x, int y, int width, int height, MenuGlyph glyph)
1756Graphics graphics,
1771public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1774public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1788public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1794public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1870public 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)
2375Graphics g,
2409internal static void PaintTableCellBorder(TableLayoutPanelCellBorderStyle borderStyle, Graphics g, Rectangle bound)
System\Windows\Forms\Rendering\ControlPaint_ModernControlButtonRenderer.cs (10)
21Graphics graphics,
151Graphics graphics,
232private static void DrawUpDownArrows(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
260private static void DrawLeftRightArrows(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
288private static void DrawEllipseSymbol(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
319private static void DrawOpenDropDownChevron(Graphics graphics, Brush brush, int centerX, int centerY, int size)
350private static void DrawUpArrow(Graphics graphics, Brush brush, int centerX, int centerY, int size)
362private static void DrawDownArrow(Graphics graphics, Brush brush, int centerX, int centerY, int size)
374private static void DrawLeftArrow(Graphics graphics, Brush brush, int centerX, int centerY, int size)
386private 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)