147 references to Graphics
DesignSurface (1)
MainForm.MyScrollableControl.cs (1)
34
var graphics = e.
Graphics
;
PresentationUI (1)
MS\Internal\Documents\DialogDivider.cs (1)
73
e.
Graphics
.DrawLine(
System.Windows.Forms (64)
System\Windows\Forms\Control.cs (8)
8149
e.
Graphics
.FillRectangle(brush, rectangle);
8165
e.
Graphics
.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1);
8167
e.
Graphics
.FillRectangle(Brushes.White, rectangle);
8168
e.
Graphics
.DrawLine(pen, clientRectangle.Left, clientRectangle.Top,
8170
e.
Graphics
.DrawLine(pen, clientRectangle.Left, clientRectangle.Bottom,
8245
using GraphicsStateScope saveState = new(newArgs.
Graphics
);
8248
newArgs.
Graphics
.Clip = transparentRegion;
8249
newArgs.
Graphics
.TranslateClip(-shift.X, -shift.Y);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (1)
66
DrawDitheredFill(e.
Graphics
, colors.ButtonFace, checkBackground, bounds);
System\Windows\Forms\Controls\Labels\Label.cs (1)
975
DrawImage(e.
Graphics
, image, r, align);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (5)
1158
using (GraphicsStateScope backgroundPaintScope = new(e.
Graphics
))
1160
e.
Graphics
.ExcludeClip(imageBounds);
1164
using GraphicsStateScope imagePaintScope = new(e.
Graphics
);
1165
e.
Graphics
.IntersectClip(imageBounds);
1167
DrawImage(e.
Graphics
, image, ClientRectangle, RtlTranslateAlignment(ImageAlign));
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
1137
pe.
Graphics
.DrawImage(_image, drawingRect);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (4)
2898
pevent.
Graphics
.FillRectangle(backgroundBrush, new Rectangle(0, 0, width, psheetLoc.Y));
2905
pevent.
Graphics
.FillRectangle(
2914
pevent.
Graphics
.FillRectangle(
2921
pevent.
Graphics
.FillRectangle(backgroundBrush, new Rectangle(0, yLast, width, Size.Height - yLast));
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.SnappableControl.cs (1)
45
e.
Graphics
.DrawRectangle(borderPen, r);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.cs (2)
87
pevent.
Graphics
.FillRectangle(SystemBrushes.Window, dropDownButtonRect);
107
ControlPaint.DrawFocusRectangle(pevent.
Graphics
, dropDownButtonRect, ForeColor, BackColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
3255
Graphics g = e.
Graphics
;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (3)
511
e.
Graphics
.DrawImage(GetSizeGripGlyph(e.
Graphics
), lRect);
519
e.
Graphics
.DrawLine(pen, 0, y, Width, y);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStripButton.cs (2)
78
DrawHightContrastDashedBorer(e.
Graphics
);
82
DrawDashedBorer(e.
Graphics
);
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
629
e.
Graphics
,
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
328
Renderer.DrawStatusStripSizingGrip(new ToolStripRenderEventArgs(e.
Graphics
, this));
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
3680
Renderer.DrawGrip(new ToolStripGripRenderEventArgs(e.
Graphics
, this));
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (3)
208
renderer.DrawButtonBackground(new ToolStripItemRenderEventArgs(e.
Graphics
, this));
212
ToolStripItemImageRenderEventArgs rea = new(e.
Graphics
, this, InternalLayout.ImageRectangle)
221
renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(e.
Graphics
, this, Text, InternalLayout.TextRectangle, ForeColor, Font, InternalLayout.TextFormat));
System\Windows\Forms\Controls\ToolStrips\ToolStripContentPanel.cs (1)
318
ToolStripContentPanelRenderEventArgs rea = new(e.
Graphics
, this);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
182
Graphics g = e.
Graphics
;
184
renderer.DrawDropDownButtonBackground(new ToolStripItemRenderEventArgs(e.
Graphics
, this));
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (1)
564
Renderer.DrawImageMargin(new ToolStripRenderEventArgs(e.
Graphics
, this, ImageMargin, SystemColors.Control));
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (3)
338
renderer.DrawLabelBackground(new ToolStripItemRenderEventArgs(e.
Graphics
, this));
342
renderer.DrawItemImage(new ToolStripItemImageRenderEventArgs(e.
Graphics
, this, InternalLayout.ImageRectangle));
345
PaintText(e.
Graphics
);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
952
Graphics g = e.
Graphics
;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
114
renderer.DrawOverflowButtonBackground(new ToolStripItemRenderEventArgs(e.
Graphics
, this));
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (1)
437
ToolStripPanelRenderEventArgs rea = new(e.
Graphics
, this);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (2)
82
Renderer.DrawToolStripBackground(new ToolStripRenderEventArgs(e.
Graphics
, this));
83
Renderer.DrawToolStripBorder(new ToolStripRenderEventArgs(e.
Graphics
, this));
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
292
Renderer!.DrawSeparator(new ToolStripSeparatorRenderEventArgs(e.
Graphics
, this, IsVertical));
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
517
Graphics g = e.
Graphics
;
System\Windows\Forms\Controls\ToolStrips\ToolStripStatusLabel.cs (3)
198
renderer.DrawToolStripStatusLabelBackground(new ToolStripItemRenderEventArgs(e.
Graphics
, this));
202
renderer.DrawItemImage(new ToolStripItemImageRenderEventArgs(e.
Graphics
, this, InternalLayout.ImageRectangle));
205
PaintText(e.
Graphics
);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (1)
1216
DrawFocus(e.
Graphics
, SplitterRectangle);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (1)
403
g = e.
Graphics
;
System\Windows\Forms\Printing\PrintPreviewControl.cs (6)
355
pevent.
Graphics
.FillRectangle(backBrush, rect);
359
DrawMessage(pevent.
Graphics
, rect, _exceptionPrinting);
373
DrawPages(pevent.
Graphics
, InsideRectangle, _pageInfo, backBrush);
712
e.
Graphics
.FillRectangle(SystemBrushes.Control, ResizeBoxRectangle);
726
ControlPaint.DrawHighContrastFocusRectangle(e.
Graphics
, focusRect, SystemColors.ControlText);
730
ControlPaint.DrawFocusRectangle(e.
Graphics
, focusRect);
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
1144
e.
Graphics
.DrawRectangle(SystemPens.ControlDark, rect);
System\Windows\Forms\Rendering\PaintEventArgs.cs (2)
134
IntPtr IDeviceContext.GetHdc() =>
Graphics
?.GetHdc() ?? IntPtr.Zero;
136
void IDeviceContext.ReleaseHdc() =>
Graphics
?.ReleaseHdc();
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
676
e.
Graphics
,
System.Windows.Forms.Design (63)
System\ComponentModel\Design\ByteViewer.cs (1)
518
Graphics g = e.
Graphics
;
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (1)
195
Graphics g = pevent.
Graphics
;
System\ComponentModel\Design\DesignerActionPanel.cs (4)
478
e.
Graphics
.FillRectangle(gradientBrush, ClientRectangle);
483
e.
Graphics
.FillRectangle(gradientBrush, ClientRectangle);
488
e.
Graphics
.DrawRectangle(borderPen, new Rectangle(0, 0, Width - 1, Height - 1));
500
Graphics g = e.
Graphics
;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (1)
57
Graphics g = e.
Graphics
;
System\Drawing\Design\ColorEditor.ColorPalette.cs (1)
359
Graphics graphics = pe.
Graphics
;
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (6)
185
ControlPaint.DrawBorder3D(e.
Graphics
, rc, Border3DStyle.Sunken);
201
ControlPaint.DrawButton(e.
Graphics
, rc, ButtonState.Normal);
270
e.
Graphics
.FillRectangle(SystemBrushes.ControlDark, rc);
271
e.
Graphics
.DrawRectangle(SystemPens.WindowFrame, rc.X, rc.Y, rc.Width - 1, rc.Height - 1);
275
ControlPaint.DrawFocusRectangle(e.
Graphics
, rc);
281
ControlPaint.DrawFocusRectangle(e.
Graphics
, rc);
System\Windows\Forms\Design\Behavior\ContainerSelectorGlyph.cs (1)
51
pe.
Graphics
.DrawImage(_glyph, _glyphBounds);
System\Windows\Forms\Design\Behavior\DesignerActionGlyph.cs (2)
210
pe.
Graphics
.DrawImage(image, _bounds.Left, _bounds.Top);
213
pe.
Graphics
.FillRectangle(DesignerUtils.HoverBrush, Rectangle.Inflate(_bounds, -1, -1));
System\Windows\Forms\Design\Behavior\GrabHandleGlyph.cs (1)
113
DesignerUtils.DrawGrabHandle(pe.
Graphics
, bounds, _isPrimary);
System\Windows\Forms\Design\Behavior\LockedBorderGlyph.cs (1)
42
DesignerUtils.DrawSelectionBorder(pe.
Graphics
, bounds);
System\Windows\Forms\Design\Behavior\LockedHandleGlyph.cs (1)
37
DesignerUtils.DrawLockedHandle(pe.
Graphics
, bounds, _isPrimary);
System\Windows\Forms\Design\Behavior\MiniLockedBorderGlyph.cs (1)
53
pe.
Graphics
.FillRectangle(new SolidBrush(SystemColors.ControlText), bounds);
System\Windows\Forms\Design\Behavior\NoResizeHandleGlyph.cs (1)
47
DesignerUtils.DrawNoResizeHandle(pe.
Graphics
, bounds, _isPrimary);
System\Windows\Forms\Design\Behavior\NoResizeSelectionBorderGlyph.cs (1)
65
DesignerUtils.DrawSelectionBorder(pe.
Graphics
, bounds);
System\Windows\Forms\Design\Behavior\SelectionBorderGlyph.cs (1)
89
DesignerUtils.DrawSelectionBorder(pe.
Graphics
, bounds);
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionGlyph.cs (1)
229
pe.
Graphics
.DrawImage(_image, _glyphBounds.Left, _glyphBounds.Top);
System\Windows\Forms\Design\ComponentTray.cs (6)
1435
Graphics gr = pe.
Graphics
;
2290
e.
Graphics
.DrawImage(_toolboxBitmap, new Rectangle(x, y, _cxIcon, _cyIcon));
2295
e.
Graphics
.DrawString(Text, Font, foreBrush, rc, format);
2302
e.
Graphics
.DrawImage(_toolboxBitmap, new Rectangle(rc.X, y, _cxIcon, _cyIcon));
2308
e.
Graphics
.DrawString(Text, Font, foreBrush, rc);
2325
e.
Graphics
.DrawImage(InheritanceUI.InheritanceGlyph, 0, 0);
System\Windows\Forms\Design\ControlDesigner.cs (14)
1543
pe.
Graphics
.DrawImage(InheritanceUI.InheritanceGlyph, 0, 0);
2263
using Region textRegion = e.
Graphics
.MeasureCharacterRanges(exceptionText, errorFont, textRect, stringFormat)[0];
2266
Region originalClip = e.
Graphics
.Clip;
2267
e.
Graphics
.ExcludeClip(textRegion);
2268
e.
Graphics
.ExcludeClip(imageRect);
2271
e.
Graphics
.FillRectangle(Brushes.White, clientRectangle);
2275
e.
Graphics
.Clip = originalClip;
2280
e.
Graphics
.DrawRectangle(pen, borderRectangle);
2284
e.
Graphics
.FillRectangle(Brushes.White, imageRect);
2285
e.
Graphics
.DrawIcon(err, imageRect.X, imageRect.Y);
2287
e.
Graphics
.IntersectClip(textRegion);
2291
e.
Graphics
.FillRectangle(Brushes.White, textRect);
2292
e.
Graphics
.DrawString(exceptionText, errorFont, new SolidBrush(Control.ForeColor), textRect, stringFormat);
2296
e.
Graphics
.Clip = originalClip;
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
1865
TextRenderer.DrawText(e.
Graphics
, Text, Font, rect, ForeColor, formatFlags);
System\Windows\Forms\Design\DockEditor.DockUI.cs (1)
302
ControlPaint.DrawButton(e.
Graphics
, rc, ButtonState.Pushed);
System\Windows\Forms\Design\GroupBoxDesigner.cs (2)
82
ControlPaint.DrawGrid(pe.
Graphics
, rectangle, GridSize, control.BackColor);
93
pe.
Graphics
.DrawImage(InheritanceUI.InheritanceGlyph, 0, 0);
System\Windows\Forms\Design\PanelDesigner.cs (1)
57
DrawBorder(pe.
Graphics
);
System\Windows\Forms\Design\ParentControlDesigner.cs (3)
2039
pe.
Graphics
.TranslateTransform(xlateX, xlateY);
2043
ControlPaint.DrawGrid(pe.
Graphics
, paintRect, GridSize, control.BackColor);
2044
pe.
Graphics
.TranslateTransform(-xlateX, -xlateY);
System\Windows\Forms\Design\PictureBoxDesigner.cs (1)
71
DrawBorder(pe.
Graphics
);
System\Windows\Forms\Design\SelectionUIService.cs (2)
774
item.DoPaint(e.
Graphics
);
781
item.DoPaint(e.
Graphics
);
System\Windows\Forms\Design\SplitterDesigner.cs (1)
48
DrawBorder(pe.
Graphics
);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
203
DrawBorder(pe.
Graphics
);
213
DrawWaterMark(pe.
Graphics
);
System\Windows\Forms\Design\TabOrder.cs (2)
667
DrawTabs(_tabControls, e.
Graphics
, true);
670
DrawTabs(_tabControls, e.
Graphics
, false);
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
474
paintEvent.
Graphics
.FillRectangle(brush, Control.ClientRectangle);
477
DrawBorder(paintEvent.
Graphics
);
System.Windows.Forms.Tests (15)
System\Windows\Forms\ControlTests.Handlers.cs (2)
4000
Assert.NotSame(graphics, e.
Graphics
);
4131
Assert.NotSame(graphics, e.
Graphics
);
System\Windows\Forms\PaintEventArgsTests.cs (3)
26
Assert.Equal(graphics, e.
Graphics
);
64
Graphics g1 = args.
Graphics
;
65
Graphics g2 = args.
Graphics
;
System\Windows\Forms\ScrollableControlTests.cs (2)
1703
Assert.NotSame(graphics, e.
Graphics
);
1847
Assert.NotSame(graphics, e.
Graphics
);
System\Windows\Forms\TableLayoutCellPaintEventArgsTests.cs (1)
27
Assert.Equal(graphics, e.
Graphics
);
System\Windows\Forms\TableLayoutPanelTests.cs (2)
1483
Assert.Same(eventArgs.
Graphics
, e.
Graphics
);
System\Windows\Forms\TabPageTests.cs (2)
4076
Assert.NotSame(graphics, e.
Graphics
);
4215
Assert.NotSame(graphics, e.
Graphics
);
System\Windows\Forms\ToolStripTests.cs (2)
6044
Assert.NotSame(graphics, e.
Graphics
);
6186
Assert.NotSame(graphics, e.
Graphics
);
TrackBarTests.cs (1)
3252
e.
Graphics
.Should().BeSameAs(graphics);
System.Windows.Forms.UI.IntegrationTests (1)
DesignBehaviorsTests.cs (1)
327
pe.
Graphics
.DrawString($"Design time \n{Control.Site?.Name} !", Control.Font, SystemBrushes.WindowText, new PointF(12, 12));
WindowsFormsIntegration (1)
System\Windows\Integration\ElementHost.cs (1)
418
e.
Graphics
.DrawImage(bitmap, SD.Point.Empty);
WinFormsControlsTest (1)
CustomComCtl32Button.cs (1)
55
control.Paint += (sender, e) => DrawRoundBorder((Control)sender, e.
Graphics
);