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,
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)
221using Graphics graphics = dc.CreateGraphics();
391internal static void PrintBorder(Graphics graphics, Rectangle bounds, BorderStyle style, Border3DStyle b3dStyle)
412Graphics g,
518public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
545Graphics graphics,
723else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
782else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
846else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
920else if (deviceContext.TryGetGraphics(create: true) is Graphics graphics)
973public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
983public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style)
994public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides)
1000public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height)
1010public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style)
1020public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style, Border3DSide sides)
1052private static void DrawBorderComplex(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
1150Graphics? graphics = context.TryGetGraphics(create: true);
1176public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1182public static void DrawButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1197Graphics graphics,
1210Graphics graphics,
1224public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1230public static void DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1252public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1258public static void DrawComboButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1270public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds)
1314private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1335Graphics graphics,
1368using (Graphics g2 = Graphics.FromImage(bitmap))
1393public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
1400public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor)
1403internal static void DrawHighContrastFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1406internal static void DrawBlackWhiteFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1409private static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color color, bool highContrast, bool blackAndWhite = false)
1425Graphics graphics,
1438using Graphics g2 = Graphics.FromImage(bitmap);
1479public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled)
1506public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor)
1552Graphics graphics,
1576internal static void DrawImageReplaceColor(Graphics g, Image image, Rectangle dest, Color oldColor, Color newColor)
1589public static void DrawImageDisabled(Graphics graphics, Image image, int x, int y, Color background)
1596internal static void DrawImageDisabled(Graphics graphics, Image image, Rectangle imageBounds, bool unscaledImage)
1633using (Graphics g = Graphics.FromImage(bitmap))
1662internal static void EnforceHeaderCellDividerContrast(Graphics graphics, Rectangle bounds)
1679public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary)
1697public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph)
1705Graphics graphics,
1719public static void DrawMenuGlyph(Graphics graphics, int x, int y, int width, int height, MenuGlyph glyph)
1727Graphics graphics,
1742public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1745public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1759public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1765public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state)
1841public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state)
1848Graphics graphics,
1864Graphics graphics,
1883public static void DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds)
1889public static void DrawSizeGrip(Graphics graphics, Color backColor, int x, int y, int width, int height)
1941Graphics graphics,
2017public static void DrawVisualStyleBorder(Graphics graphics, Rectangle bounds)
2317Graphics g,
2351internal 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)