40 instantiations of Region
System.Windows.Forms (13)
System\Windows\Forms\Components\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
318using Region windowRegion = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\Components\ErrorProvider\ErrorProvider.IconRegion.cs (1)
40_region = new Region(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\Control.cs (1)
2518using Region working = new(temp);
System\Windows\Forms\Controls\ComboBox\ComboBox.ModernComboAdapter.cs (1)
378using Region corners = new(bounds);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (1)
5488using (Region region = new(scroll))
System\Windows\Forms\Controls\Labels\LinkLabel.cs (3)
603Region visualRegion = new(visualRectangle); 1093using Region region = new(focusRectangle); 1288g.Clip = IsLabelFilledByOneLink() ? new Region(focusRectangle) : link.VisualRegion;
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
2769using Region region = new(bounds);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1815region ??= new Region(regionRect);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (1)
29Region region = new(bounds);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (1)
881Region parentRegionToPaint = new(topLeftParentHorizontalPixels);
System\Windows\Forms\ParentBackgroundRenderer.cs (1)
21using Region paintRegion = new(bounds);
System.Windows.Forms.Design (27)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
139result.Clip = new Region(_adornerWindow.DesignerFrameDisplayRectangle);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (3)
697_dragImageRegion = new Region(controlRect); 794Region invalidRegion = new(unionRectangle); 948_dragImageRegion = new Region(controlRect);
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (3)
386using (Region newRegion = new(borderRect)) 853using Region newRegion = new(newBorderRect); 862using Region oldRegion = new(oldBorderRect);
System\Windows\Forms\Design\Behavior\SelectionManager.cs (1)
313Region toRefresh = new(Rectangle.Empty);
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (1)
325using Region invalidRegion = new(_lastRectangle);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2136using Region nonClient = new(controlScreenBounds);
System\Windows\Forms\Design\ParentControlDesigner.cs (3)
1790using (Region newRegion = new(frameRect)) 1976using Region newRegion = new(frameRect); 1993using Region oldRegion = new(oldFrameRect);
System\Windows\Forms\Design\SelectionUIService.ContainerSelectionUIItem.cs (2)
73_region = new(rect); 77_region = new(Rectangle.Empty);
System\Windows\Forms\Design\SelectionUIService.cs (1)
824Region region = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (2)
330_region = new(_outerRect); 335_region = new(Rectangle.Empty);
System\Windows\Forms\Design\TabOrder.cs (2)
194_region = new Region(new Rectangle(0, 0, 0, 0)); 205_region = new Region(ctlOuter);
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (3)
462invalidateRegion = new Region(invalidateBounds); 468itemRegion = new Region(invalidateBounds); 497invalidateRegion = new Region(invalidateBounds);
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
82Region rgn = new(bounds);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
1153using Region invalidatingRegion = new(_dropDownSizeToInvalidate); 1884using Region regionToInvalidate = new(_boundsToInvalidateOnRemove);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
800Region rgn = new(invalidateBounds);
107 references to Region
System.Drawing (1)
System.Drawing.cs (1)
141[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Region))]
System.Windows.Forms (60)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (4)
63private Region ActiveXMergeRegion(Region region) => ActiveXInstance.MergeRegion(region); 1211internal Region MergeRegion(Region region)
System\Windows\Forms\Components\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
318using Region windowRegion = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\Components\ErrorProvider\ErrorProvider.IconRegion.cs (2)
15private Region? _region; 31public unsafe Region Region
System\Windows\Forms\Control.cs (12)
2518using Region working = new(temp); 2989public Region? Region 2991get => Properties.GetValueOrDefault<Region>(s_regionProperty); 2994Region? oldRegion = SetRegionInternal(value); 3003private Region? SetRegionInternal(Region? region) 3005Region? oldRegion = Properties.AddOrRemoveValue(s_regionProperty, region); 3020using Region? regionCopy = IsActiveX ? ActiveXMergeRegion(region.Clone()) : null; 6118public void Invalidate(Region? region) 6129public unsafe void Invalidate(Region? region, bool invalidateChildren) 8022Region? region = Region; 9051internal unsafe void PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region? transparentRegion = null)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (2)
428Region oldClip = graphics.Clip; 440Region newClip = oldClip.Clone();
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
76Region? originalClip = null;
System\Windows\Forms\Controls\ComboBox\ComboBox.ModernComboAdapter.cs (1)
378using Region corners = new(bounds);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
5488using (Region region = new(scroll)) 19477Region? clipRegion = null; 19563using Region clipRegion = g.Clip; 19580using Region clipRegion = g.Clip;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
864using Region originalClip = g.Clip;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1591Region? clipRegion = null;
System\Windows\Forms\Controls\Labels\LinkLabel.cs (8)
43private Region? _textRegion; 521private Region? EnsureRun(Graphics g) 549Region[] textRegions = g.MeasureCharacterRanges(text, alwaysUnderlined, ClientRectWithPadding, textFormat); 603Region visualRegion = new(visualRectangle); 981Region? textRegion = EnsureRun(g); 1034Region originalClip = g.Clip; 1093using Region region = new(focusRectangle); 1241Region textRegion)
System\Windows\Forms\Controls\Labels\LinkLabel.Link.cs (1)
179internal Region? VisualRegion { get; set; }
System\Windows\Forms\Controls\Labels\LinkLabel.Link.LinkAccessibleObject.cs (1)
36Region? region = _owningLink.VisualRegion;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1572Region oldClip = g.Clip;
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
2769using Region region = new(bounds);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (5)
1782Region? region = null; 2627using Region? transparentRegion = Renderer.GetTransparentRegion(this); 3452using Region? transparentRegion = Renderer.GetTransparentRegion(this); 3641using (Region? transparentRegion = Renderer.GetTransparentRegion(this)) 3676private void EraseCorners(PaintEventArgs e, Region transparentRegion)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
665public new Region? Region
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (1)
29Region region = new(bounds);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (2)
833internal override Region? GetTransparentRegion(ToolStrip toolStrip) 881Region parentRegionToPaint = new(topLeftParentHorizontalPixels);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
565internal virtual Region? GetTransparentRegion(ToolStrip toolStrip) => null;
System\Windows\Forms\ParentBackgroundRenderer.cs (3)
21using Region paintRegion = new(bounds); 25using Region currentClip = graphics.Clip; 46/// The modern rounded chrome masks its corners with a <see cref="Region"/>, which cannot be
System\Windows\Forms\Rendering\ControlPaint.cs (1)
1938Region clip = graphics.Clip;
System\Windows\Forms\Rendering\DrawingEventArgs.cs (1)
156graphics.GetContextInfo(out PointF offset, out Region? clip);
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (4)
446public unsafe Region? GetBackgroundRegion(IDeviceContext dc, Rectangle bounds) 469Region region = Region.FromHrgn(hrgn); 738public HitTestCode HitTestBackground(Graphics g, Rectangle backgroundRectangle, Region region, Point pt, HitTestOptions options)
System.Windows.Forms.Design (43)
System\Windows\Forms\Design\Behavior\Adorner.cs (1)
84public void Invalidate(Region region)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (2)
127internal void InvalidateAdornerWindow(Region region) 303using Region region = hrgn.ToRegion();
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
377public void Invalidate(Region r) => _adornerWindow.InvalidateAdornerWindow(r);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (3)
58private Region _dragImageRegion; 794Region invalidRegion = new(unionRectangle); 798using (Region invalidDragRegion = _dragImageRegion.Clone())
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (4)
49private Region _lastResizeRegion; 386using (Region newRegion = new(borderRect)) 853using Region newRegion = new(newBorderRect); 862using Region oldRegion = new(oldBorderRect);
System\Windows\Forms\Design\Behavior\SelectionManager.cs (3)
311private Region DetermineRegionToRefresh(object? primarySelection, Rectangle[] previousSelectionBounds, Rectangle[] currentSelectionBounds) 313Region toRefresh = new(Rectangle.Empty); 422Region toUpdate = DetermineRegionToRefresh(primarySelection, _previousSelectionBounds, _currentSelectionBounds);
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (1)
325using Region invalidRegion = new(_lastRectangle);
System\Windows\Forms\Design\ControlDesigner.cs (4)
2069using Region region = hrgn.ToRegion(); 2136using Region nonClient = new(controlScreenBounds); 2278using Region textRegion = e.Graphics.MeasureCharacterRanges(exceptionText, errorFont, textRect, stringFormat)[0]; 2281Region originalClip = e.Graphics.Clip;
System\Windows\Forms\Design\DesignerFrame.cs (3)
252void IOverlayService.InvalidateOverlays(Region screenRegion) 474public void InvalidateOverlays(Region screenRegion) 482using Region intersectionRegion = screenRegion.Clone();
System\Windows\Forms\Design\DesignerUtils.cs (2)
212public static void DrawResizeBorder(Graphics g, Region resizeBorder, Color backColor) 226public static void DrawFrame(Graphics g, Region resizeBorder, FrameStyle style, Color backColor)
System\Windows\Forms\Design\IOverlayService.cs (1)
43void InvalidateOverlays(Region screenRegion);
System\Windows\Forms\Design\ParentControlDesigner.cs (3)
1790using (Region newRegion = new(frameRect)) 1976using Region newRegion = new(frameRect); 1993using Region oldRegion = new(oldFrameRect);
System\Windows\Forms\Design\SelectionUIService.ContainerSelectionUIItem.cs (1)
63public override Region GetRegion()
System\Windows\Forms\Design\SelectionUIService.cs (1)
824Region region = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (3)
64internal Region? _region; // region object that defines the shape 134Region oldClip = graphics.Clip; 324public virtual Region GetRegion()
System\Windows\Forms\Design\TabOrder.cs (2)
33private Region? _region; 213Region clip = graphics.Clip;
System\Windows\Forms\Design\ToolStripAdornerWindowService.cs (2)
128public void Invalidate(Region r) 250internal void InvalidateAdornerWindow(Region region)
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (2)
430Region invalidateRegion = null; 431Region itemRegion = null;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
82Region rgn = new(bounds);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
1153using Region invalidatingRegion = new(_dropDownSizeToInvalidate); 1884using Region regionToInvalidate = new(_boundsToInvalidateOnRemove);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
800Region rgn = new(invalidateBounds);
System.Windows.Forms.Primitives (3)
System\Drawing\RegionExtensions.cs (2)
8public static Region ToRegion(this RegionScope scope) => Region.FromHrgn(scope.Region);
System\Windows\Forms\GraphicsClipScope.cs (1)
13private readonly Region _originalClip;