System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (9)
86/// Get <see cref="StringFormat"/> object for rendering text using GDI+ (<see cref="Graphics"/>).
97internal static void DrawDitheredFill(Graphics g, Color color1, Color color2, Rectangle bounds)
339Graphics g = e.GraphicsInternal;
366private void DrawFocus(Graphics g, Rectangle r)
374internal virtual void DrawImageCore(Graphics graphics, Image image, Rectangle imageBounds, Point imageStart, LayoutData layout)
434Graphics? graphics = deviceContext.TryGetGraphics(create: true);
458Graphics g = e.GraphicsInternal;
648internal static ColorOptions PaintFlatRender(Graphics g, Color foreColor, Color backColor, bool enabled) =>
653internal static ColorOptions PaintPopupRender(Graphics g, Color foreColor, Color backColor, bool enabled) =>
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)
26private static void DrawBackground(Graphics g, Rectangle bounds, ComboBoxState state)
48public static void DrawTextBox(Graphics g, Rectangle bounds, ComboBoxState state)
58public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, ComboBoxState state)
66public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, ComboBoxState state)
74public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, TextFormatFlags flags, ComboBoxState state)
86public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
98public 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,
3067Graphics graphics,
3082Graphics graphics,
3119Graphics graphics,
3524Graphics graphics,
3544private static void PaintErrorIcon(Graphics graphics, Rectangle iconBounds)
3557Graphics graphics,
3589Graphics graphics,
3629internal void PaintWork(Graphics graphics,
3954internal 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)
1187protected int GetLabelTextWidth(string? text, Graphics graphics, Font font)
1210public int GetValueTextWidth(string text, Graphics graphics, Font font)
1502/// Paints the label portion of this <see cref="GridEntry"/> into the given <see cref="Graphics"/> object.
1511Graphics g,
1628/// the given <see cref="Graphics"/> object.
1630private void PaintOutlineGlyph(Graphics g, Rectangle r)
1664void PaintOutlineWithExplorerTreeStyle(Graphics g, Rectangle r, HWND hwnd)
1705Graphics graphics,
1729void PaintOutlineWithClassicStyle(Graphics g, Rectangle r)
1781/// Paints the value portion of this <see cref="GridEntry"/> into the given <see cref="Graphics"/> object.
1789Graphics 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)
224using Graphics graphics = dc.CreateGraphics();
394internal static void PrintBorder(Graphics graphics, Rectangle bounds, BorderStyle style, Border3DStyle b3dStyle)
415Graphics g,
521public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
548Graphics graphics,
726else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
785else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
849else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
923else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
976public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
986public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style)
997public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides)
1003public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height)
1013public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style)
1023public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style, Border3DSide sides)
1055private static void DrawBorderComplex(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
1153Graphics? graphics = context.TryGetGraphics(create: true);
1179public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1185public static void DrawButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1200Graphics graphics,
1213Graphics graphics,
1227public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1233public static void DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1255public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1261public static void DrawComboButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1273public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds)
1317private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1338Graphics graphics,
1371using (Graphics g2 = Graphics.FromImage(bitmap))
1397public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
1404public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor)
1407internal static void DrawHighContrastFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1410internal static void DrawBlackWhiteFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1413private static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color color, bool highContrast, bool blackAndWhite = false)
1429Graphics graphics,
1442using Graphics g2 = Graphics.FromImage(bitmap);
1483public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled)
1510public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor)
1556Graphics graphics,
1580internal static void DrawImageReplaceColor(Graphics g, Image image, Rectangle dest, Color oldColor, Color newColor)
1593public static void DrawImageDisabled(Graphics graphics, Image image, int x, int y, Color background)
1600internal static void DrawImageDisabled(Graphics graphics, Image image, Rectangle imageBounds, bool unscaledImage)
1637using (Graphics g = Graphics.FromImage(bitmap))
1666internal static void EnforceHeaderCellDividerContrast(Graphics graphics, Rectangle bounds)
1683public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary)
1701public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph)
1709Graphics graphics,
1723public static void DrawMenuGlyph(Graphics graphics, int x, int y, int width, int height, MenuGlyph glyph)
1731Graphics graphics,
1746public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1749public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1763public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1769public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1845public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state)
1852Graphics graphics,
1868Graphics graphics,
1887public static void DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds)
1893public static void DrawSizeGrip(Graphics graphics, Color backColor, int x, int y, int width, int height)
1945Graphics graphics,
2021public static void DrawVisualStyleBorder(Graphics graphics, Rectangle bounds)
2321Graphics g,
2355internal static void PaintTableCellBorder(TableLayoutPanelCellBorderStyle borderStyle, Graphics g, Rectangle bound)
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)