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