System\Windows\Forms\Control.cs (42)
1102public Rectangle Bounds
1258public Rectangle ClientRectangle => new Rectangle(0, 0, _clientWidth, _clientHeight);
1743public virtual Rectangle DisplayRectangle
4570Rectangle originalBounds;
4588Rectangle parentClient = _parent.ClientRectangle;
4995public void DrawToBitmap(Bitmap bitmap, Rectangle targetBounds)
5282internal virtual Rectangle ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight)
5290Rectangle newBounds = new(suggestedX, suggestedY, 0, 0)
5370protected virtual Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified)
5600private protected virtual IList<Rectangle> GetNeighboringToolsRectangles()
5932OnInvalidated(new InvalidateEventArgs(Rectangle.Ceiling(region.GetBounds(graphics))));
5983public void Invalidate(Rectangle rc)
5994public unsafe void Invalidate(Rectangle rc, bool invalidateChildren)
6611protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
8007Rectangle cliprect = e.InvalidRect;
8010cliprect = Rectangle.Intersect(ClientRectangle, cliprect);
8154internal void PaintBackground(PaintEventArgs e, Rectangle rectangle) =>
8157internal void PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset = default)
8208private static void PaintBackColor(PaintEventArgs e, Rectangle rectangle, Color backColor)
8238Rectangle clientRectangle = ClientRectangle;
8239Rectangle rectangle = clientRectangle;
8267internal unsafe void PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region? transparentRegion = null)
8307Rectangle shift = new(-Left, -Top, parent.Width, parent.Height);
8310Rectangle newClipRect = new(
8823private protected virtual void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds)
8837Rectangle clientBounds = new(clientOffset, ClientSize);
9392public Rectangle RectangleToClient(Rectangle r)
9402public Rectangle RectangleToScreen(Rectangle r)
9813Rectangle rawScaledBounds = GetScaledBounds(Bounds, factor, specified);
10168Rectangle adjustedBounds = ApplyBoundsConstraints(x, y, width, height);
11838Rectangle clip;
11879Rectangle band = ClientRectangle;
12722void IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
12826Rectangle IKeyboardToolTip.GetNativeScreenRectangle() => GetToolNativeScreenRectangle();
12828IList<Rectangle> IKeyboardToolTip.GetNeighboringToolsRectangles() => GetNeighboringToolsRectangles();
12855private IList<Rectangle> GetOwnNeighboringToolsRectangles()
12860return Array.Empty<Rectangle>();
12863List<Rectangle> neighboringControlsRectangles = new(4);
12893internal virtual Rectangle GetToolNativeScreenRectangle()
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (21)
99internal static void DrawDitheredFill(Graphics g, Color color1, Color color2, Rectangle bounds)
105protected void Draw3DBorder(IDeviceContext deviceContext, Rectangle bounds, ColorData colors, bool raised)
131private void Draw3DBorderHighContrastRaised(IDeviceContext deviceContext, ref Rectangle bounds, ColorData colors)
189private static void Draw3DBorderNormal(IDeviceContext deviceContext, ref Rectangle bounds, ColorData colors)
234private void Draw3DBorderRaised(IDeviceContext deviceContext, ref Rectangle bounds, ColorData colors)
295protected internal static void Draw3DLiteBorder(IDeviceContext deviceContext, Rectangle r, ColorData colors, bool up)
325Rectangle bounds,
333Rectangle left = new(bounds.X, bounds.Y, size, bounds.Height);
334Rectangle right = new(bounds.X + bounds.Width - size, bounds.Y, size, bounds.Height);
335Rectangle top = new(bounds.X + size, bounds.Y, bounds.Width - size * 2, size);
336Rectangle bottom = new(bounds.X + size, bounds.Y + bounds.Height - size, bounds.Width - size * 2, size);
358internal static void DrawFlatFocus(IDeviceContext deviceContext, Rectangle r, Color color)
368private void DrawFocus(Graphics g, Rectangle r)
376internal virtual void DrawImageCore(Graphics graphics, Image image, Rectangle imageBounds, Point imageStart, LayoutData layout)
382Rectangle bounds = new(
425internal static void DrawDefaultBorder(IDeviceContext deviceContext, Rectangle r, Color color, bool isDefault)
455Rectangle r = layout.TextBounds;
516internal void PaintButtonBackground(PaintEventArgs e, Rectangle bounds, Brush? background)
535Rectangle maxFocus = layout.Focus;
552Rectangle bounds = Control.ClientRectangle;
573Rectangle clientRectangle,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (12)
22public Rectangle Client;
261layout.Face = Rectangle.Inflate(layout.Client, -fullBorderSize, -fullBorderSize);
280Rectangle textAdjusted = new(
287? Rectangle.Union(textAdjusted, layout.ImageBounds)
363Rectangle field = Rectangle.Inflate(layout.Face, -PaddingSize, -PaddingSize);
483Rectangle maxBounds = Rectangle.Inflate(layout.Field, -TextImageInset, -TextImageInset);
510Rectangle maxCombinedBounds = maxBounds;
515Rectangle combinedBounds = LayoutUtils.Align(combinedSize, maxCombinedBounds, ContentAlignment.MiddleCenter);
614layout.TextBounds = Rectangle.Intersect(layout.TextBounds, layout.Field);
629layout.ImageBounds = Rectangle.Intersect(layout.ImageBounds, layout.Field);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (12)
36Rectangle bounds = layout.CheckBounds;
86Rectangle bounds,
119Rectangle bounds,
171Rectangle fullSize = layout.CheckBounds;
201internal static Rectangle DrawPopupBorder(Graphics g, Rectangle r, ColorData colors)
207internal static Rectangle DrawPopupBorder(PaintEventArgs e, Rectangle r, ColorData colors)
213internal static Rectangle DrawPopupBorder(HDC hdc, Rectangle r, ColorData colors)
294private static Bitmap GetCheckBoxImage(Color checkColor, Rectangle fullSize, ref Color cacheCheckColor, ref Bitmap? cacheCheckImage)
336layout.Focus = Control.AutoSize ? Rectangle.Inflate(layout.CheckBounds, -2, -2) : layout.Field;
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\ButtonDarkModeRendererBase.cs (8)
33Rectangle bounds,
40Action<Rectangle> paintImage,
41Action<Rectangle, Color, bool> paintField)
56Rectangle paddedBounds = new(
63Rectangle contentBounds = DrawButtonBackground(graphics, paddedBounds, state, isDefault);
81public abstract Rectangle DrawButtonBackground(Graphics graphics, Rectangle bounds, PushButtonState state, bool isDefault);
83public abstract void DrawFocusIndicator(Graphics graphics, Rectangle contentBounds, bool isDefault);
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\FlatButtonDarkModeRenderer.cs (12)
25public override Rectangle DrawButtonBackground(
26Graphics graphics, Rectangle bounds, PushButtonState state, bool isDefault)
36return Rectangle.Inflate(bounds, -3, -3);
39public override void DrawFocusIndicator(Graphics g, Rectangle contentBounds, bool isDefault)
41Rectangle focus = Rectangle.Inflate(contentBounds, FocusIndicatorInflate, FocusIndicatorInflate);
80private static void DrawButtonBorder(Graphics g, Rectangle bounds, PushButtonState state, bool isDefault)
85Rectangle outer = Rectangle.Inflate(bounds, -1, -1);
92Rectangle inner = Rectangle.Inflate(outer, -1, -1);
97private static void DrawSingleBorder(Graphics g, Rectangle rect, Color color)
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\PopupButtonDarkModeRenderer.cs (12)
33public override Rectangle DrawButtonBackground(Graphics graphics, Rectangle bounds, PushButtonState state, bool isDefault)
37Rectangle paddedBounds = Rectangle.Inflate(bounds, -padding.Left, -padding.Top);
40Rectangle contentBounds = Rectangle.Inflate(paddedBounds, -padding.Left, -padding.Top);
69public override void DrawFocusIndicator(Graphics graphics, Rectangle contentBounds, bool isDefault)
72Rectangle focusRect = Rectangle.Inflate(contentBounds, -FocusPadding, -FocusPadding);
126private static void DrawButtonBorder(Graphics graphics, Rectangle bounds, PushButtonState state, bool isDefault)
140Rectangle borderRect = bounds;
227private static GraphicsPath CreateRoundedRectanglePath(Rectangle bounds, int radius)
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\SystemButtonDarkModeRenderer.cs (14)
33public override Rectangle DrawButtonBackground(Graphics graphics, Rectangle bounds, PushButtonState state, bool isDefault)
36Rectangle fillBounds = Rectangle.Inflate(bounds, -SystemStylePadding, -SystemStylePadding);
54public override void DrawFocusIndicator(Graphics graphics, Rectangle contentBounds, bool isDefault)
57Rectangle focusRect = new(
119Rectangle bounds,
137Rectangle borderRect = Rectangle.Inflate(bounds, -SystemStylePadding, -SystemStylePadding);
199private static GraphicsPath GetTopLeftSegmentPath(Rectangle bounds, int radius)
206Rectangle arcRect = new(bounds.Location, new Size(diameter, diameter));
238private static GraphicsPath GetBottomRightSegmentPath(Rectangle bounds, int radius)
251Rectangle arcRect = new(bounds.Right - diameter, bounds.Bottom - diameter, diameter, diameter);
277private static GraphicsPath CreateRoundedRectanglePath(Rectangle bounds, int radius)
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (36)
53public static void DrawParentBackground(Graphics g, Rectangle bounds, Control childControl)
56internal static void DrawParentBackground(IDeviceContext dc, 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) =>
69internal static void DrawButton(IDeviceContext deviceContext, Rectangle bounds, PushButtonState state)
88Rectangle bounds,
93Rectangle contentBounds;
111contentBounds = Rectangle.Inflate(bounds, -3, -3);
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)
144Rectangle contentBounds;
158contentBounds = Rectangle.Inflate(bounds, -3, -3);
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)
174Rectangle contentBounds;
188contentBounds = Rectangle.Inflate(bounds, -3, -3);
197/// <inheritdoc cref="DrawButton(Graphics, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, PushButtonState)"/>
200Rectangle bounds,
204Rectangle imageBounds,
222Rectangle bounds,
227Rectangle imageBounds,
234Rectangle bounds,
239Rectangle imageBounds,
243Rectangle contentBounds;
269contentBounds = Rectangle.Inflate(bounds, -3, -3);
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (21)
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)"/>
58Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(g, state));
79Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(hdc, state, hwnd));
83/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
87Rectangle textBounds,
101/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
105Rectangle textBounds,
115Rectangle textBounds,
123Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(g, state, hwnd));
155/// <inheritdoc cref="DrawCheckBox(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, CheckBoxState)"/>
159Rectangle textBounds,
163Rectangle imageBounds,
183Rectangle textBounds,
188Rectangle imageBounds,
192Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(g, state));
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (23)
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)" />
60Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(hdc, state, hwnd));
70Rectangle glyphBounds;
87/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
91Rectangle textBounds,
102/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
106Rectangle textBounds,
119Rectangle textBounds,
127Rectangle glyphBounds;
155/// <inheritdoc cref="DrawRadioButton(Graphics, Point, Rectangle, string?, Font?, TextFormatFlags, Image, Rectangle, bool, RadioButtonState)" />
159Rectangle textBounds,
163Rectangle imageBounds,
183Rectangle textBounds,
188Rectangle imageBounds,
206Rectangle textBounds,
211Rectangle imageBounds,
216Rectangle glyphBounds;
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (12)
30private static void DrawBackground(Graphics g, Rectangle bounds, ComboBoxState state)
41Rectangle fillRect = t_visualStyleRenderer.GetBackgroundContentRectangle(g, bounds);
52public static void DrawTextBox(Graphics g, Rectangle bounds, ComboBoxState state)
62public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, ComboBoxState state)
70public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, ComboBoxState state)
78public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, TextFormatFlags flags, ComboBoxState state)
82Rectangle textBounds = t_visualStyleRenderer.GetBackgroundContentRectangle(g, bounds);
90public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
102public static void DrawDropDownButton(Graphics g, Rectangle bounds, ComboBoxState state)
115internal static void DrawDropDownButtonForHandle(HDC hdc, Rectangle bounds, ComboBoxState state, HWND hwnd)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (130)
2431Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data);
2434clip = Rectangle.Union(_layout.TopLeftHeader, clip);
2455Rectangle cursorClip = _layout.ColumnHeaders;
2535private Rectangle GetResizeClipRectangle(int columnIndex)
2537Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data);
2736Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data);
2739clip = Rectangle.Union(_layout.TopLeftHeader, clip);
2771Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data);
2965private Rectangle CalcColRelocationFeedbackRect(int mouseX)
2967Rectangle r, inside = _layout.ColumnHeaders;
2970inside = Rectangle.Union(_layout.TopLeftHeader, inside);
2997private Rectangle CalcColResizeFeedbackRect(int mouseX)
2999Rectangle inside = _layout.Data;
3000Rectangle r = new(
3018private Rectangle CalcRowResizeFeedbackRect(int mouseY)
3020Rectangle inside = _layout.Data;
3021Rectangle r = new(
3374private void CaptureMouse(Rectangle cursorClip)
4359Rectangle oldResizeRect = _layout.ResizeBoxRect;
4366Rectangle inside = newLayout.Inside;
4379Rectangle insideLeft = inside;
4384Rectangle colHeaders = insideLeft;
4393newLayout.ColumnHeaders = Rectangle.Empty;
4398Rectangle rowHeaders = insideLeft;
4415Rectangle topLeft;
4416Rectangle colHeaders = newLayout.ColumnHeaders;
4435newLayout.TopLeftHeader = Rectangle.Empty;
4440newLayout.RowHeaders = Rectangle.Empty;
4441newLayout.TopLeftHeader = Rectangle.Empty;
5422private RECT[]? CreateScrollableRegion(Rectangle scroll)
5482ref Rectangle rectScrollingArea,
5628Rectangle r = CalcColRelocationFeedbackRect(mouseX);
5632Rectangle rectInsertionBar = new(0, _layout.ColumnHeaders.Top, InsertionBarWidth, _layout.ColumnHeaders.Height);
5685Rectangle r = CalcColResizeFeedbackRect(mouseX);
5695Rectangle r = CalcRowResizeFeedbackRect(mouseY);
5699private void DrawShadowRect(Rectangle r)
5720private void DrawSplitBar(Rectangle r)
6068Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
6421Rectangle rectScreen = Screen.FromControl(this).WorkingArea;
6814internal Rectangle GetCellAdjustedDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow)
6816Rectangle rect = GetCellDisplayRectangle(columnIndex, rowIndex, cutOverflow);
7040public Rectangle GetCellDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow)
7042Rectangle rowRect;
7043Rectangle columnRect;
8190public Rectangle GetColumnDisplayRectangle(int columnIndex, bool cutOverflow)
8198private Rectangle GetColumnDisplayRectanglePrivate(int columnIndex, bool cutOverflow)
8204return Rectangle.Empty;
8207Rectangle data = _layout.Data;
8301Rectangle columnRect = RightToLeftInternal
8314return Rectangle.Empty;
8321Rectangle data = _layout.Data;
8561Rectangle rectScrollingArea = _layout.Data;
8578rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.RowHeaders);
8670rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.ColumnHeaders);
9020public Rectangle GetRowDisplayRectangle(int rowIndex, bool cutOverflow)
9028private Rectangle GetRowDisplayRectanglePrivate(int rowIndex, bool cutOverflow)
9034return Rectangle.Empty;
9037Rectangle data = _layout.Data;
9088Rectangle rowRect = new(data.X, cy, data.Width, displayHeight);
9102return Rectangle.Empty;
9107Rectangle data = _layout.Data;
9791Rectangle cellDisplayRect = GetCellAdjustedDisplayRectangle(columnIndex, rowIndex, true);
9816Rectangle columnDisplayRect = GetColumnDisplayRectanglePrivate(columnIndex, true);
9860Rectangle rowDisplayRect = GetRowDisplayRectanglePrivate(rowIndex, true);
9893Rectangle rowDisplayRect, data;
10428Rectangle lastSplitBarRect = CalcRowResizeFeedbackRect(_lastRowSplitBar);
10489Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
10496Rectangle lastSplitBarRect = CalcColResizeFeedbackRect(_lastColSplitBar);
13447Invalidate(Rectangle.Union(_layout.ColumnHeaders, _layout.Data));
13910Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
14487Rectangle rightArea = _layout.Data;
14490rightArea = Rectangle.Union(rightArea, _layout.ColumnHeaders);
16678Rectangle clipRect = e.ClipRectangle;
16679Rectangle gridRect = GetGridRectangle();
16683clipRect = Rectangle.Union(clipRect, CalcRowResizeFeedbackRect(_currentRowSplitBar));
16687clipRect = Rectangle.Union(clipRect, CalcColResizeFeedbackRect(_currentColSplitBar));
16735private Rectangle GetGridRectangle()
16737Rectangle gridRect = _layout.Data;
16740gridRect = Rectangle.Union(gridRect, _layout.RowHeaders);
16754gridRect = Rectangle.Union(gridRect, _layout.ColumnHeaders);
16769private Rectangle GetGridFocusRectangle()
16771Rectangle focusRect = GetGridRectangle();
16783Rectangle focusRect = GetGridFocusRectangle();
16819private void InvalidateRectangleEdges(Rectangle rect)
16822Rectangle edge = rect;
17435Rectangle right;
17436Rectangle bottom;
17437Rectangle oldClientRectangle = _layout.ClientRectangle;
17438Rectangle oldGridFocusRectangle = GetGridFocusRectangle();
17455Rectangle newClientRectangle = _normalClientRectangle;
17456Rectangle newGridFocusRectangle = DisplayRectangle;
18184Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.RowHeaders));
18817Rectangle rect = Screen.GetBounds(pt);
19201protected virtual void PaintBackground(Graphics graphics, Rectangle clipBounds, Rectangle gridBounds)
19204Rectangle rcBelowRows = gridBounds;
19230Rectangle rcNextRows = gridBounds;
19272private void PaintBorder(Graphics g, Rectangle clipRect, Rectangle bounds)
19284Rectangle edge = new(0, 0, bounds.Width, borderWidth);
19333private void PaintColumnHeaders(Graphics g, Rectangle clipBounds, bool singleBorderAdded)
19337Rectangle bandBounds, cellBounds;
19402Rectangle scrollingBounds = bandBounds;
19416Rectangle rowRect = bandBounds;
19487Rectangle gridBounds,
19488Rectangle clipRect,
19492Rectangle rc = gridBounds;
19507Rectangle columnHeadersClip = _layout.ColumnHeaders;
19551Rectangle boundingRect,
19552Rectangle clipRect,
19557Rectangle rowBounds;
19679Rectangle cellBounds = _layout.TopLeftHeader;
19804Rectangle editingZone = _layout.Data;
19820Rectangle cellBounds = new(leftEdge, GetRowYFromIndex(_ptCurrentCell.Y),
19822Rectangle cellClip = cellBounds;
25592Cursor.Clip = Rectangle.Empty;
25863Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
26328Rectangle rowsRect = _layout.Data;
26331rowsRect = Rectangle.Union(rowsRect, _layout.RowHeaders);
28949Rectangle rectUpper = GetCellAdjustedDisplayRectangle(-1, rowIndexStart, true);
28950Rectangle rectLower = GetCellAdjustedDisplayRectangle(-1, rowIndexEnd, true);
28960Invalidate(Rectangle.Union(rectUpper, rectLower));
28999Rectangle bottomArea = _layout.Data;
29002bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
29074Rectangle bottomArea = _layout.Data;
29077bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (29)
27private static Rectangle s_rectThemeMargins = new(-1, -1, 0, 0);
149protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
155return Rectangle.Empty;
162out Rectangle cellBounds);
164Rectangle contentBounds = PaintPrivate(
181Rectangle contentBoundsDebug = PaintPrivate(
214protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
224return Rectangle.Empty;
231out Rectangle cellBounds);
233Rectangle errorIconBounds = PaintPrivate(
250Rectangle errorIconBoundsDebug = PaintPrivate(
290Rectangle borderWidthsRect = StdBorderWidths;
306Rectangle rectThemeMargins = GetThemeMargins(graphics);
408private static Rectangle GetThemeMargins(Graphics g)
412Rectangle rectCell = new(0, 0, DATAGRIDVIEWBUTTONCELL_themeMargin, DATAGRIDVIEWBUTTONCELL_themeMargin);
413Rectangle rectContent = DataGridViewButtonCellRenderer.DataGridViewButtonRenderer.GetBackgroundContentRectangle(g, rectCell);
598Rectangle clipBounds,
599Rectangle cellBounds,
635private Rectangle PaintPrivate(
637Rectangle clipBounds,
638Rectangle cellBounds,
662Rectangle resultBounds;
675Rectangle valBounds = cellBounds;
676Rectangle borderWidths = BorderWidths(advancedBorderStyle);
684return Rectangle.Empty;
708Rectangle errorBounds = valBounds;
867resultBounds = Rectangle.Empty;
873resultBounds = Rectangle.Empty;
887ControlPaint.DrawFocusRectangle(g, Rectangle.Inflate(valBounds, -1, -1), Color.Empty, cellStyle.ForeColor);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (45)
53private readonly List<Rectangle> _nonEmptyNeighbors;
105public Rectangle ContentBounds => GetContentBounds(RowIndex);
195public Rectangle ErrorIconBounds => GetErrorIconBounds(RowIndex);
291Rectangle IKeyboardToolTip.GetNativeScreenRectangle() => AccessibilityObject.Bounds;
302IList<Rectangle> IKeyboardToolTip.GetNeighboringToolsRectangles()
593private protected Rectangle StdBorderWidths
611return Rectangle.Empty;
829protected virtual Rectangle BorderWidths(DataGridViewAdvancedBorderStyle advancedBorderStyle)
833Rectangle rect = new Rectangle
956out Rectangle cellBounds)
1014internal Rectangle ComputeErrorIconBounds(Rectangle cellValueBounds)
1019Rectangle bmpRect = new(DataGridView!.RightToLeftInternal ?
1029return Rectangle.Empty;
1463public Rectangle GetContentBounds(int rowIndex)
1467return Rectangle.Empty;
1476protected virtual Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex) => Rectangle.Empty;
1530internal Rectangle GetErrorIconBounds(int rowIndex)
1537protected virtual Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex) => Rectangle.Empty;
2755Rectangle contentBounds = GetContentBounds(screen, dataGridViewCellStyle, rowIndex);
3070Rectangle clipBounds,
3071Rectangle cellBounds,
3085Rectangle clipBounds,
3086Rectangle cellBounds,
3122Rectangle clipBounds,
3123Rectangle bounds,
3527Rectangle clipBounds,
3528Rectangle cellValueBounds,
3546private static void PaintErrorIcon(Graphics graphics, Rectangle iconBounds)
3562Rectangle cellBounds,
3563Rectangle cellValueBounds,
3570Rectangle iconBounds = GetErrorIconBounds(graphics, cellStyle, rowIndex);
3592Rectangle bounds,
3597Rectangle rectPadding;
3632Rectangle clipBounds,
3633Rectangle cellBounds,
3750Rectangle cellBounds,
3751Rectangle cellClip,
3758Rectangle editingControlBounds = PositionEditingPanel(
3783public virtual Rectangle PositionEditingPanel(
3784Rectangle cellBounds,
3785Rectangle cellClip,
3807Rectangle borderAndPaddingWidths = BorderWidths(dgvabsEffective);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (26)
444protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
450return Rectangle.Empty;
457out Rectangle cellBounds);
459Rectangle checkBoxBounds = PaintPrivate(
476Rectangle checkBoxBoundsDebug = PaintPrivate(
506protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
516return Rectangle.Empty;
525return Rectangle.Empty;
532out Rectangle cellBounds);
534Rectangle errorIconBounds = PaintPrivate(
649Rectangle borderWidthsRect = StdBorderWidths;
734Rectangle borderWidths = BorderWidths(dgvabsEffective);
997Rectangle clipBounds,
998Rectangle cellBounds,
1039private Rectangle PaintPrivate(
1041Rectangle clipBounds,
1042Rectangle cellBounds,
1063Rectangle resultBounds;
1070Rectangle valBounds = cellBounds;
1071Rectangle borderWidths = BorderWidths(advancedBorderStyle);
1154Rectangle errorBounds = valBounds;
1286Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.Width, checkBoxSize.Height);
1344Rectangle fullSize = new(checkBoxX - 1, checkBoxY - 1, checkBoxSize.Width + 3, checkBoxSize.Height + 3);
1389Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.Width - 1, checkBoxSize.Height - 1);
1548resultBounds = Rectangle.Empty;
1554resultBounds = Rectangle.Empty;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (35)
531Rectangle borderAndPaddingWidths = BorderWidths(dgvabsEffective);
728protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
734return Rectangle.Empty;
748out Rectangle cellBounds);
750Rectangle contentBounds = PaintPrivate(
768Rectangle contentBoundsDebug = PaintPrivate(
831protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
841return Rectangle.Empty;
851ComputeBorderStyleCellStateAndCellBounds(rowIndex, out DataGridViewAdvancedBorderStyle dgvabsEffective, out DataGridViewElementStates cellState, out Rectangle cellBounds);
853Rectangle errorIconBounds = PaintPrivate(
863out Rectangle dropDownButtonRect, // not used
871Rectangle errorIconBoundsDebug = PaintPrivate(
1173Rectangle borderWidthsRect = StdBorderWidths;
1328Rectangle rectBottomSection = DataGridView.GetCellDisplayRectangle(ColumnIndex, rowIndex, true);
1760Rectangle cellBounds = DataGridView.GetCellDisplayRectangle(OwningColumn.Index, rowIndex, cutOverflow: false);
1771Rectangle dropDownButtonRect;
1811Rectangle clipBounds,
1812Rectangle cellBounds,
1852private Rectangle PaintPrivate(
1854Rectangle clipBounds,
1855Rectangle cellBounds,
1862out Rectangle dropDownButtonRect,
1880Rectangle resultBounds = Rectangle.Empty;
1881dropDownButtonRect = Rectangle.Empty;
1909Rectangle borderWidths = BorderWidths(advancedBorderStyle);
1910Rectangle valBounds = cellBounds;
2005Rectangle dropRect;
2205Rectangle errorBounds = valBounds;
2206Rectangle textBounds = Rectangle.Inflate(valBounds, -2, -2);
2254Rectangle focusBounds = textBounds;
2267Rectangle focusBounds = textBounds;
2353return Rectangle.Empty;
2366resultBounds = Rectangle.Empty;
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\DataGridViewImageCell.cs (32)
225protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
231return Rectangle.Empty;
247out Rectangle cellBounds);
249Rectangle imgBounds = PaintPrivate(
265Rectangle imgBoundsDebug = PaintPrivate(
287protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
297return Rectangle.Empty;
313out Rectangle cellBounds);
315Rectangle errBounds = PaintPrivate(
331Rectangle errBoundsDebug = PaintPrivate(graphics,
409Rectangle borderWidthsRect = StdBorderWidths;
568private Rectangle ImageBounds(
569Rectangle bounds,
578Rectangle imageBounds = Rectangle.Empty;
679Rectangle clipBounds,
680Rectangle cellBounds,
716private Rectangle PaintPrivate(
718Rectangle clipBounds,
719Rectangle cellBounds,
743Rectangle resultBounds = Rectangle.Empty;
744Rectangle valBounds = cellBounds;
745Rectangle borderWidths = BorderWidths(advancedBorderStyle);
755? Rectangle.Empty
761return Rectangle.Empty;
765Rectangle imageBounds = valBounds;
794return Rectangle.Empty;
842Rectangle imageBounds2 = ImageBounds(
867g.SetClip(Rectangle.Intersect(
868Rectangle.Intersect(imageBounds2, imageBounds),
869Rectangle.Truncate(g.VisibleClipBounds)));
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (26)
183protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
189return Rectangle.Empty;
204out Rectangle cellBounds);
206Rectangle contentBounds = PaintPrivate(
222Rectangle contentBoundsDebug = PaintPrivate(
242protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
251return Rectangle.Empty;
258out Rectangle cellBounds);
269Rectangle errorBounds = PaintPrivate(
529Rectangle borderWidthsRect = BorderWidths(dgvabsEffective);
538Rectangle rectThemeMargins = GetThemeMargins(graphics);
575Rectangle clipBounds,
576Rectangle cellBounds,
612private Rectangle PaintPrivate(
614Rectangle clipBounds,
615Rectangle cellBounds,
638Rectangle resultBounds = Rectangle.Empty;
645Rectangle valBounds = cellBounds;
646Rectangle borderWidths = BorderWidths(advancedBorderStyle);
651Rectangle backgroundBounds = valBounds;
657return Rectangle.Empty;
715Rectangle rectThemeMargins = GetThemeMargins(graphics);
766Rectangle errorBounds = valBounds;
1024Rectangle bounds,
1033Rectangle bmpRect = new(width, height, s_iconsWidth, s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (26)
137private Rectangle GetAdjustedEditingControlBounds(Rectangle editingControlBounds, DataGridViewCellStyle cellStyle)
256protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
262return Rectangle.Empty;
278out Rectangle cellBounds);
280Rectangle textBounds = PaintPrivate(
296Rectangle textBoundsDebug = PaintPrivate(
323protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
333return Rectangle.Empty;
340out Rectangle cellBounds);
342Rectangle errorBounds = PaintPrivate(graphics,
366Rectangle errorBoundsDebug = PaintPrivate(graphics,
399Rectangle borderWidthsRect = StdBorderWidths;
597Rectangle clipBounds,
598Rectangle cellBounds,
639private Rectangle PaintPrivate(
641Rectangle clipBounds,
642Rectangle cellBounds,
664Rectangle resultBounds = Rectangle.Empty;
671Rectangle borderWidths = BorderWidths(advancedBorderStyle);
672Rectangle valBounds = cellBounds;
717Rectangle errorBounds = valBounds;
783Rectangle cellBounds,
784Rectangle cellClip,
791Rectangle editingControlBounds = PositionEditingPanel(
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (23)
26protected override Rectangle GetContentBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
34return Rectangle.Empty;
45ComputeBorderStyleCellStateAndCellBounds(rowIndex, out DataGridViewAdvancedBorderStyle dgvabsEffective, out DataGridViewElementStates cellState, out Rectangle cellBounds);
47Rectangle contentBounds = PaintPrivate(
63Rectangle contentBoundsDebug = PaintPrivate(
83protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
89return Rectangle.Empty;
94ComputeBorderStyleCellStateAndCellBounds(rowIndex, out DataGridViewAdvancedBorderStyle dgvabsEffective, out DataGridViewElementStates cellState, out Rectangle cellBounds);
96Rectangle errorBounds = PaintPrivate(
114Rectangle errorBoundsDebug = PaintPrivate(
145Rectangle borderWidthsRect = BorderWidths(DataGridView.AdjustedTopLeftHeaderBorderStyle);
167Rectangle clipBounds,
168Rectangle cellBounds,
204private Rectangle PaintPrivate(
206Rectangle clipBounds,
207Rectangle cellBounds,
230Rectangle resultBounds = Rectangle.Empty;
232Rectangle valBounds = cellBounds;
233Rectangle borderWidths = BorderWidths(advancedBorderStyle);
296Rectangle errorBounds = valBounds;
358Rectangle clipBounds,
359Rectangle bounds,
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (18)
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)
85Rectangle bounds,
97Rectangle bounds,
106Rectangle bounds,
127Rectangle bounds,
137Rectangle bounds,
157private static void DrawThemedGroupBoxNoText(Graphics g, Rectangle bounds, GroupBoxState state)
168Rectangle bounds,
178Rectangle textBounds = bounds;
205Rectangle boxBounds = bounds;
213Rectangle clipLeft = boxBounds;
214Rectangle clipMiddle = boxBounds;
215Rectangle clipRight = boxBounds;
246private static void DrawUnthemedGroupBoxNoText(Graphics g, Rectangle bounds)
274Rectangle bounds,
281Rectangle textBounds = bounds;
System\Windows\Forms\Controls\Labels\Label.cs (10)
871protected Rectangle CalcImageRenderBounds(Image image, Rectangle r, ContentAlignment align)
964private void DrawImage(PaintEventArgs e, Image image, Rectangle r, ContentAlignment align)
980protected void DrawImage(Graphics g, Image image, Rectangle r, ContentAlignment align)
983private void DrawImageInternal(Graphics g, Image image, Rectangle r, ContentAlignment align)
985Rectangle loc = CalcImageRenderBounds(image, r, align);
1252Rectangle face = LayoutUtils.DeflateRect(ClientRectangle, Padding);
1269Rectangle clientRect = ClientRectangle;
1349private protected override void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds)
1433Rectangle rectInScreen = RectangleToScreen(new Rectangle(0, 0, Width, Height));
System\Windows\Forms\Controls\Labels\LinkLabel.cs (14)
145private Rectangle ClientRectWithPadding => LayoutUtils.DeflateRect(ClientRectangle, Padding);
372internal static Rectangle CalcTextRenderBounds(Rectangle textRect, Rectangle clientRect, ContentAlignment align)
556Rectangle clientRectWithPadding = ClientRectWithPadding;
580Rectangle visualRectangle = new(
986Rectangle clientRect = ClientRectWithPadding;
1080focusRectangle = CalcTextRenderBounds(Rectangle.Round(focusRectangle), ClientRectWithPadding, RtlTranslateContent(TextAlign));
1135Rectangle clientRectWidthPadding = ClientRectWithPadding;
1156Rectangle imageBounds = CalcImageRenderBounds(image, ClientRectangle, RtlTranslateAlignment(ImageAlign));
1300Rectangle clientAreaMinusPadding = ClientRectWithPadding;
1326ControlPaint.DrawFocusRectangle(g, Rectangle.Ceiling(focusRectangle), ForeColor, BackColor);
1332ControlPaint.DrawFocusRectangle(g, Rectangle.Ceiling(rect), ForeColor, BackColor);
1364Rectangle clientRectWithPadding = ClientRectWithPadding;
System\Windows\Forms\Controls\ListView\ListView.cs (23)
2637Rectangle itemBounds = GetItemRectOrEmpty(itemIndex);
2723Rectangle subItemBounds = GetSubItemRect(itemIndex, nmcd->iSubItem);
3239Rectangle itemBounds = lvi.Bounds;
3245Rectangle iconBounds = GetItemRect(lvi.Index, ItemBoundsPortion.Icon);
3574public Rectangle GetItemRect(int index) => GetItemRect(index, 0);
3579public Rectangle GetItemRect(int index, ItemBoundsPortion portion)
3589return Rectangle.Empty;
3602: (Rectangle)itemrect;
3609private Rectangle GetItemRectOrEmpty(int index)
3613return Rectangle.Empty;
3618return Rectangle.Empty;
3627? Rectangle.Empty
3628: (Rectangle)itemrect;
3634internal Rectangle GetSubItemRect(int itemIndex, int subItemIndex)
3639internal Rectangle GetSubItemRect(int itemIndex, int subItemIndex, ItemBoundsPortion portion)
3643return Rectangle.Empty;
3665return Rectangle.Empty;
3679: (Rectangle)itemrect;
5045Rectangle rectInvalid = Items[startIndex].Bounds;
5048rectInvalid = Rectangle.Union(rectInvalid, Items[index].Bounds);
5053rectInvalid = Rectangle.Union(rectInvalid, Items[startIndex - 1].Bounds);
5064rectInvalid = Rectangle.Union(rectInvalid, Items[endIndex + 1].Bounds);
6960Rectangle rect = new(0, 0, Size.Width - 1, Size.Height - 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (25)
46private Rectangle _outlineRect = Rectangle.Empty;
640public Rectangle OutlineRectangle
666_outlineRect = Rectangle.Empty;
1503Rectangle rect,
1504Rectangle clipRect,
1568Rectangle textRect = new(stringX, rect.Y + 1, maxSpace, rect.Height - 1);
1570if (!Rectangle.Intersect(textRect, clipRect).IsEmpty)
1621private void PaintOutlineGlyph(Graphics g, Rectangle r)
1632_outlineRect = Rectangle.Empty;
1647_outlineRect = Rectangle.Empty;
1655void PaintOutlineWithExplorerTreeStyle(Graphics g, Rectangle r, HWND hwnd)
1658Rectangle outline = Rectangle.Intersect(r, OutlineRectangle);
1698Rectangle rectangle,
1720void PaintOutlineWithClassicStyle(Graphics g, Rectangle r)
1723Rectangle outline = Rectangle.Intersect(r, OutlineRectangle);
1781Rectangle rect,
1782Rectangle clipRect,
1836Rectangle rectPaint = new(
1842if (!Rectangle.Intersect(rectPaint, clipRect).IsEmpty)
1879if (Rectangle.Intersect(rect, clipRect).IsEmpty)
1896Rectangle textRectangle = new(
1993Rectangle outlineRect = OutlineRectangle;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (44)
83private Rectangle _lastClientRect = Rectangle.Empty;
478Rectangle rect = GetRectangle(_selectedRow, RowLabel);
614internal Rectangle AccessibilityGetGridEntryBounds(GridEntry gridEntry)
619return Rectangle.Empty;
622Rectangle rect = GetRectangle(row, RowValue | RowLabel);
628Rectangle parent = gridEntry.OwnerGrid.GridViewAccessibleObject.Bounds;
634return Rectangle.Empty;
698private static void AdjustOrigin(Graphics g, Point newOrigin, ref Rectangle r)
899private void CommonEditorUse(Control control, Rectangle targetRectangle)
903Rectangle rectCur = control.Bounds;
906Rectangle clientRect = ClientRectangle;
912targetRectangle = Rectangle.Intersect(clientRect, targetRectangle);
926targetRectangle = Rectangle.Empty;
1113Rectangle rect,
1116Rectangle clipRect)
1126clipRect = Rectangle.Intersect(rect, clipRect);
1171private void DrawValue(Graphics g, int row, Rectangle clipRect)
1179Rectangle rect = GetRectangle(row, RowValue);
1181clipRect = Rectangle.Intersect(clipRect, rect);
1386Rectangle r = GetRectangle(row, rowValue ? RowValue : RowLabel);
1440Rectangle rect = GetRectangle(_selectedRow, RowValue);
1443Rectangle rectScreen = Screen.FromControl(EditTextBox).WorkingArea;
1902public Rectangle GetRectangle(int row, int flRow)
1904Rectangle rect = new(0, 0, 0, 0);
1990Rectangle rect = ClientRectangle;
1995Rectangle boundsScroll = ScrollBar.Bounds;
2023Rectangle rect;
2138Rectangle r = ClientRectangle;
2318Rectangle drawBounds = e.Bounds;
2382Rectangle clearRect = new(1, 1, Size.Width - 2, Size.Height - 2);
3019Rectangle r = GetRectangle(pos.Y, RowLabel);
3093Rectangle itemRect = GetRectangle(point.Y, point.X);
3299Rectangle clipRect = e.ClipRectangle;
3365Rectangle rect = GetRectangle(i, RowLabel);
3388Rectangle clearRect = new(1, yPosition, Size.Width - 2, Size.Height - yPosition - 1);
3614Rectangle newRect = ClientRectangle;
3615int yDelta = _lastClientRect == Rectangle.Empty ? 0 : newRect.Height - _lastClientRect.Height;
3621Rectangle rectInvalidate = new(_lastClientRect.Width - 1, 0, newRect.Width - _lastClientRect.Width + 1, _lastClientRect.Height);
3627Rectangle rectInvalidate = new(0, _lastClientRect.Height - 1, _lastClientRect.Width, newRect.Height - _lastClientRect.Height + 1);
3815internal static void PositionTooltip(Control parent, GridToolTip toolTip, Rectangle itemRect)
4341Rectangle rect = GetRectangle(row, RowValue);
4360Rectangle rectTarget = new(
5295Rectangle itemRect = GetRectangle(mouseLoc.Y, mouseLoc.X);
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (21)
27public static void DrawTabItem(Graphics g, Rectangle bounds, TabItemState state)
37public static void DrawTabItem(Graphics g, Rectangle bounds, bool focused, TabItemState state)
44Rectangle contentBounds = Rectangle.Inflate(bounds, -3, -3);
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)
78Rectangle contentBounds = Rectangle.Inflate(bounds, -3, -3);
91public static void DrawTabItem(Graphics g, Rectangle bounds, Image image, Rectangle imageRectangle, bool focused, TabItemState state)
98Rectangle contentBounds = Rectangle.Inflate(bounds, -3, -3);
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)
128Rectangle contentBounds = Rectangle.Inflate(bounds, -3, -3);
142public static void DrawTabPage(Graphics g, Rectangle bounds)
145internal static void DrawTabPage(IDeviceContext deviceContext, Rectangle bounds)
System\Windows\Forms\Controls\TextBox\TextBoxRenderer.cs (10)
25private static void DrawBackground(Graphics g, Rectangle bounds, TextBoxState state)
33Rectangle fillRect = t_visualStyleRenderer.GetBackgroundContentRectangle(g, bounds);
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)
70Rectangle textBounds = t_visualStyleRenderer.GetBackgroundContentRectangle(g, bounds);
78public static void DrawTextBox(Graphics g, Rectangle bounds, string? textBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, TextBoxState state)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (14)
116internal virtual Rectangle DropDownButtonArea => Bounds;
140Rectangle bounds = GetDropDownBounds(dropDownDirection);
141Rectangle ownerItemBounds = new(TranslatePoint(Point.Empty, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ScreenCoords), Size);
142Rectangle intersectionBetweenChildAndParent = Rectangle.Intersect(bounds, ownerItemBounds);
151int newIntersectionWidth = Rectangle.Intersect(GetDropDownBounds(newDropDownDirection), ownerItemBounds).Width;
300private Rectangle DropDownDirectionToDropDownBounds(ToolStripDropDownDirection dropDownDirection, Rectangle dropDownBounds)
377private Rectangle GetDropDownBounds(ToolStripDropDownDirection dropDownDirection)
379Rectangle dropDownBounds = new(Point.Empty, DropDown.GetSuggestedSize());
384Rectangle itemScreenBounds = new(TranslatePoint(Point.Empty, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ScreenCoords), Size);
386if (Rectangle.Intersect(dropDownBounds, itemScreenBounds).Height > 1)
391if (Rectangle.Intersect(dropDownBounds, itemScreenBounds).Width > 1)
397if (Rectangle.Intersect(dropDownBounds, itemScreenBounds).Width > 1)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (57)
165Rectangle overflowArrowRect;
230Rectangle bounds = new(Point.Empty, item.Size);
266Rectangle bounds = new(Point.Empty, item.Size);
269Rectangle fillRect = item.Selected ? item.ContentRectangle : bounds;
282Rectangle buttonBounds = item.ButtonBounds;
296Rectangle dropDownRect = item.DropDownButtonBounds;
346Rectangle bounds = new(Point.Empty, item?.Size ?? Size.Empty);
354Rectangle fillRect = item is not null && item.Selected ? item.ContentRectangle : bounds;
416Rectangle bounds = new(Point.Empty, toolStrip.Size);
453Rectangle edging;
482Rectangle bounds = e.GripBounds;
497Rectangle[] shadowRects = new Rectangle[numRectangles];
545Rectangle bounds = new(Point.Empty, item.Size);
591Rectangle fillRect = bounds;
648Rectangle fillRect = bounds;
696Rectangle bounds = e.AffectedBounds;
742Rectangle imageRect = e.ImageRectangle;
757if (imageRect != Rectangle.Empty && image is not null)
845Rectangle bounds = new(Point.Empty, toolStrip.Size);
859Rectangle topLeftParentHorizontalPixels = new(topLeft, s_onePix);
860Rectangle bottomLeftParentHorizontalPixels = new(bottomLeft, new Size(2, 1));
861Rectangle bottomLeftParentVerticalPixels = new(bottomLeft.X, bottomLeft.Y - 1, 1, 2);
864Rectangle bottomRightHorizontalPixels = new(bottomRight.X - 1, bottomRight.Y, 2, 1);
865Rectangle bottomRightVerticalPixels = new(bottomRight.X, bottomRight.Y - 1, 1, 2);
868Rectangle topRightHorizontalPixels, topRightVerticalPixels;
952private static void FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, int firstGradientWidth, int secondGradientWidth, LinearGradientMode mode, bool flipHorizontal)
959Rectangle endGradient = bounds;
960Rectangle beginGradient = bounds;
1044Rectangle bounds = ScaleHelper.IsScalingRequired
1078private void RenderPressedGradient(Graphics g, Rectangle bounds)
1107Rectangle bounds = new(Point.Empty, item.Size);
1109Rectangle fillRect = item.Selected ? item.ContentRectangle : bounds;
1140Rectangle gradientBounds = new(Point.Empty, parent.Size);
1154Rectangle gradientBounds = new(Point.Empty, control.Size);
1173Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1182Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1194Rectangle bounds = new(Point.Empty, toolStripDropDown.Size);
1216Rectangle overflowBoundsFill = new(Point.Empty, e.Item.Size);
1217Rectangle bounds = overflowBoundsFill;
1320Rectangle fillRect = new(overflowBoundsFill.X - 1, 0, 1, 1);
1337Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1339Rectangle displayRect = toolStrip.DisplayRectangle;
1353Rectangle topLeftShadowRect = new(topLeft, s_onePix);
1357Rectangle topLeftShadowRect2 = new(topLeft, s_onePix);
1361Rectangle topRightShadowRect = new(topRight, s_onePix);
1365Rectangle topRightShadowRect2 = topRightShadowRect;
1369Rectangle[] paintRects = [topLeftShadowRect, topLeftShadowRect2, topRightShadowRect, topRightShadowRect2];
1376paintRects[i] = Rectangle.Empty;
1395Rectangle otherBottom = new(bottomLeft.X, bottomLeft.Y - 2, 1, 1);
1403private void RenderSelectedButtonFill(Graphics g, Rectangle bounds)
1427private void RenderCheckedButtonFill(Graphics g, Rectangle bounds)
1451private void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical)
1539private void RenderPressedButtonFill(Graphics g, Rectangle bounds)
1566Rectangle bounds = new(Point.Empty, item.Size);
1569Rectangle fillRect = (item.Selected) ? item.ContentRectangle : bounds;
1645private static Point RenderArrowInternal(Graphics g, Rectangle dropDownRect, ArrowDirection direction, Brush brush)
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (24)
12private Rectangle _displayRectangle = Rectangle.Empty;
177_displayRectangle = Rectangle.Empty;
211Rectangle clientRectangle = toolStrip.ClientRectangle;
217Rectangle alignedLeftItems = Rectangle.Empty;
218Rectangle alignedRightItems = Rectangle.Empty;
301alignedRightItems = (alignedRightItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height)
302: Rectangle.Union(alignedRightItems, new Rectangle(x, y, itemSize.Width, itemSize.Height));
314alignedLeftItems = (alignedLeftItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height)
315: Rectangle.Union(alignedLeftItems, new Rectangle(x, y, itemSize.Width, itemSize.Height));
339Rectangle bounds = LayoutUtils.VAlign(item.Size, _displayRectangle, AnchorStyles.None);
357Rectangle clientRectangle = toolStrip.ClientRectangle;
362Rectangle alignedLeftItems = Rectangle.Empty;
363Rectangle alignedRightItems = Rectangle.Empty;
438alignedRightItems = (alignedRightItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height)
439: Rectangle.Union(alignedRightItems, new Rectangle(x, y, itemSize.Width, itemSize.Height));
446alignedLeftItems = (alignedLeftItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height)
447: Rectangle.Union(alignedLeftItems, new Rectangle(x, y, itemSize.Width, itemSize.Height));
472Rectangle bounds = LayoutUtils.HAlign(item.Size, _displayRectangle, AnchorStyles.None);
495Rectangle itemBounds = new(itemLocation, itemSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (18)
108private static void FillBackground(Graphics g, Rectangle bounds, Color backColor)
233Rectangle bounds = e.AffectedBounds;
290Rectangle bounds = toolStrip.ClientRectangle;
331Rectangle bounds = new(Point.Empty, e.GripBounds.Size);
474Rectangle bounds = new(Point.Empty, item.Size);
497Rectangle fillRect = new(Point.Empty, item.Size);
605Rectangle splitButtonBounds = splitButton.ButtonBounds;
622Rectangle fillRect = splitButton.ContentRectangle;
642var clientBounds = item.ClientBounds;
651Rectangle splitButtonButtonRect = splitButton.ButtonBounds;
655Rectangle bounds = new(Point.Empty, splitButton.Size);
658Rectangle fillRect = splitButton.Selected ? splitButton.ContentRectangle : bounds;
674Rectangle dropDownRect = splitButton.DropDownButtonBounds;
720var bounds = item.ClientBounds;
730Rectangle fillRect = item.ContentRectangle;
748private static void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical)
803private static void RenderSmall3DBorderInternal(Graphics g, Rectangle bounds, ToolBarState state, bool rightToLeft)
852Rectangle fillRect = item.ContentRectangle;
System\Windows\Forms\Controls\TrackBar\TrackBarRenderer.cs (10)
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)
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (15)
451internal override Rectangle ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight)
516Rectangle editBounds = _upDownEdit.Bounds;
523Rectangle bounds = ClientRectangle;
524Rectangle clipBounds = e.ClipRectangle;
529Rectangle clipLeft = new(bounds.Left, bounds.Top, border, bounds.Height);
530Rectangle clipTop = new(bounds.Left, bounds.Top, bounds.Width, border);
531Rectangle clipRight = new(bounds.Right - border, bounds.Top, border, bounds.Height);
532Rectangle clipBottom = new(bounds.Left, bounds.Bottom - border, bounds.Width, border);
545Rectangle backRect = editBounds;
557Rectangle backRect = editBounds;
832Rectangle upDownEditBounds = Rectangle.Empty;
833Rectangle upDownButtonsBounds = Rectangle.Empty;
835Rectangle clientArea = new(Point.Empty, ClientSize);
System\Windows\Forms\Form.cs (23)
151private Rectangle _restoredWindowBounds = new(-1, -1, -1, -1);
158private Rectangle _restoreBounds = new(-1, -1, -1, -1);
677Rectangle preClientUpdateRestoredWindowBounds = _restoredWindowBounds;
891public Rectangle DesktopBounds
895Rectangle screen = SystemInformation.WorkingArea;
896Rectangle bounds = Bounds;
918Rectangle screen = SystemInformation.WorkingArea;
1153protected Rectangle MaximizedBounds
1155get => Properties.GetValueOrDefault<Rectangle>(s_propMaximizedBounds);
1309Rectangle bounds = Bounds;
1660public Rectangle RestoreBounds
3107Rectangle bounds = Bounds;
3701Rectangle clientRect = mdiclient is null ? Rectangle.Empty : mdiclient.ClientRectangle;
3723Rectangle screenRect = desktop.WorkingArea;
3908Rectangle screenRect = desktop.WorkingArea;
3964Rectangle screenRect = desktop.WorkingArea;
5202protected override Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified)
5394Rectangle workingArea = SystemInformation.WorkingArea;
5403Rectangle workingArea = SystemInformation.WorkingArea;
6869Rectangle maximizedBounds = MaximizedBounds;
6882private unsafe void WmGetMinMaxInfoHelper(ref Message m, Size minTrack, Size maxTrack, Rectangle maximizedBounds)
System\Windows\Forms\Input\Cursor.cs (8)
115/// Gets or sets a <see cref="Rectangle"/> that represents the current clipping
118public static unsafe Rectangle Clip
248private void DrawImageCore(Graphics graphics, Rectangle imageRect, Rectangle targetRect, bool stretch)
350public void Draw(Graphics g, Rectangle targetRect)
352DrawImageCore(g, Rectangle.Empty, targetRect, stretch: false);
358public void DrawStretched(Graphics g, Rectangle targetRect)
360DrawImageCore(g, Rectangle.Empty, targetRect, stretch: true);
System\Windows\Forms\Layout\DefaultLayout.cs (42)
31Rectangle bounds = GetCachedBounds(element);
47Rectangle newBounds = bounds;
77private static Rectangle GetGrowthBounds(IArrangedElement element, Size newSize)
80Rectangle oldBounds = GetCachedBounds(element);
98Rectangle newBounds = new(location, newSize);
149private static Rectangle GetAnchorDestination(IArrangedElement element, Rectangle displayRect, bool measureOnly)
157private static Rectangle ComputeAnchoredBoundsV2(IArrangedElement element, Rectangle displayRectangle)
159Rectangle bounds = GetCachedBounds(element);
236private static Rectangle ComputeAnchoredBounds(IArrangedElement element, Rectangle displayRect, bool measureOnly)
294Rectangle cachedBounds = GetCachedBounds(element);
351Rectangle displayRectangle = container.DisplayRectangle;
379Rectangle remainingBounds = measureOnly ? Rectangle.Empty : container.DisplayRectangle;
400Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height);
413Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Bottom - elementSize.Height, elementSize.Width, elementSize.Height);
426Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height);
439Rectangle newElementBounds = new(remainingBounds.Right - elementSize.Width, remainingBounds.Y, elementSize.Width, elementSize.Height);
457Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height);
483private static void TryCalculatePreferredSizeDockedControl(IArrangedElement element, Rectangle newElementBounds, bool measureOnly, ref Size preferredSize, ref Rectangle remainingBounds)
732Rectangle cachedBounds = GetCachedBounds(element);
741Rectangle elementBounds = element.Bounds;
747Rectangle parentDisplayRect = element.Container.DisplayRectangle;
876Rectangle displayRectangle = control.Parent!.DisplayRectangle;
877Rectangle elementBounds = GetCachedBounds(control);
987Rectangle displayRect = element.Container!.DisplayRectangle;
1002private static Rectangle GetCachedBounds(IArrangedElement element)
1011return (Rectangle)bounds;
1027Rectangle displayRectangle = container.DisplayRectangle;
1058Rectangle bounds = (Rectangle)entry.Value!;
1071private static void SetCachedBounds(IArrangedElement element, Rectangle bounds)
1123Rectangle elementSpace = LayoutUtils.InflateRect(GetCachedBounds(element), margin);
1146Rectangle bounds = GetCachedBounds(element);
1151Rectangle anchorDest = GetAnchorDestination(element, Rectangle.Empty, measureOnly: true);
1162Rectangle anchorDest = GetAnchorDestination(element, Rectangle.Empty, measureOnly: true);
1166Rectangle bounds = GetCachedBounds(element);
System\Windows\Forms\Layout\FlowLayout.cs (8)
25Rectangle measureBounds = new(new Point(0, 0), proposedConstraints);
53private static Size TryCalculatePreferredSize(IArrangedElement container, Rectangle displayRect, bool measureOnly)
76Rectangle measureBounds = new(displayRect.X, displayRect.Y, displayRect.Width, displayRect.Height - layoutSize.Height);
86Rectangle rowBounds = new(displayRect.X,
117Rectangle rowBounds)
141Rectangle displayRectangle,
161Rectangle rowBounds,
226Rectangle cellBounds = new(location, new Size(requiredSize.Width, rowBounds.Height));
System\Windows\Forms\Layout\LayoutUtils.cs (43)
16public static readonly Rectangle s_maxRectangle = new(0, 0, int.MaxValue, int.MaxValue);
219public static bool IsIntersectHorizontally(Rectangle rect1, Rectangle rect2)
241public static bool IsIntersectVertically(Rectangle rect1, Rectangle rect2)
275public static Rectangle AlignAndStretch(Size fitThis, Rectangle withinThis, AnchorStyles anchorStyles)
280public static Rectangle Align(Size alignThis, Rectangle withinThis, AnchorStyles anchorStyles)
285public static Rectangle Align(Size alignThis, Rectangle withinThis, ContentAlignment align)
290public static Rectangle HAlign(Size alignThis, Rectangle withinThis, AnchorStyles anchorStyles)
306private static Rectangle HAlign(Size alignThis, Rectangle withinThis, ContentAlignment align)
322public static Rectangle VAlign(Size alignThis, Rectangle withinThis, AnchorStyles anchorStyles)
338public static Rectangle VAlign(Size alignThis, Rectangle withinThis, ContentAlignment align)
372public static Rectangle InflateRect(Rectangle rect, Padding padding)
381public static Rectangle DeflateRect(Rectangle rect, Padding padding)
440public static Rectangle FlipRectangle(Rectangle rect)
448public static Rectangle FlipRectangleIf(bool condition, Rectangle rect)
488public static bool IsZeroWidthOrHeight(Rectangle rectangle)
503public static void SplitRegion(Rectangle bounds, Size specifiedContent, AnchorStyles region1Align, out Rectangle region1, out Rectangle region2)
533Debug.Assert(Rectangle.Union(region1, region2) == bounds,
538public static void ExpandRegionsToFillBounds(Rectangle bounds, AnchorStyles region1Align, ref Rectangle region1, ref Rectangle region2)
567Debug.Assert(Rectangle.Union(region1, region2) == bounds, "region1 and region2 do not add up to bounds.");
589private static Rectangle SubstituteSpecifiedBounds(Rectangle originalBounds, Rectangle substitutionBounds, AnchorStyles specified)
595return Rectangle.FromLTRB(left, top, right, bottom);
601public static Rectangle RTLTranslate(Rectangle bounds, Rectangle withinBounds)
System\Windows\Forms\Layout\TableLayout.cs (6)
1250Rectangle cellBounds = new((int)(startX + cellBorderWidth / 2.0f), (int)(top + cellBorderWidth / 2.0f), width - cellBorderWidth, height - cellBorderWidth);
1268Rectangle elementBounds = LayoutUtils.AlignAndStretch(GetElementSize(element, cellBounds.Size), cellBounds, anchorStyles);
1474Rectangle elementBounds1 = layoutInfo1.Element.Bounds;
1475Rectangle cellsOccupied1 = new(layoutInfo1.ColumnStart, layoutInfo1.RowStart, layoutInfo1.ColumnSpan, layoutInfo1.RowSpan);
1479Rectangle elementBounds2 = layoutInfo2.Element.Bounds;
1480Rectangle cellsOccupied2 = new(layoutInfo2.ColumnStart, layoutInfo2.RowStart, layoutInfo2.ColumnSpan, layoutInfo2.RowSpan);
System\Windows\Forms\Printing\PrintPreviewControl.cs (14)
353Rectangle rect = InsideRectangle;
424private Rectangle InnerClientRectangle
428Rectangle rect = ClientRectangle;
437private Rectangle InsideRectangle
441Rectangle rect = InnerClientRectangle;
462private Rectangle FocusRectangle => new(0, 0, Width - 1, Height - 1);
464private Rectangle ResizeBoxRectangle => new(_vScrollBar.Left, _hScrollBar.Top, _vScrollBar.Width, _hScrollBar.Height);
593private void DrawMessage(Graphics g, Rectangle rect, bool isExceptionPrinting)
614private void DrawPages(Graphics g, Rectangle rect, PreviewPageInfo[] pages, Brush backBrush)
634Rectangle[] pageRenderArea = new Rectangle[_rows * _columns];
685Rectangle box = pageRenderArea[i];
717Rectangle focusRect = FocusRectangle;
792Rectangle availableRect = InnerClientRectangle;
System\Windows\Forms\Rendering\ControlPaint.cs (56)
98internal static Rectangle CalculateBackgroundImageRectangle(Rectangle bounds, Size imageSize, ImageLayout imageLayout)
100Rectangle result = bounds;
419internal static void PrintBorder(Graphics graphics, Rectangle bounds, BorderStyle style, Border3DStyle b3dStyle)
444Rectangle bounds,
445Rectangle clipRect,
477Rectangle imageRectangle = CalculateBackgroundImageRectangle(bounds, backgroundImage.Size, backgroundImageLayout);
506Rectangle imageRect = imageRectangle;
508Rectangle partOfImageToDraw = new(Point.Empty, imageRect.Size);
520Rectangle imageRect = imageRectangle;
522Rectangle partOfImageToDraw = new(
553public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
581Rectangle bounds,
600Rectangle bounds,
1008public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
1018public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style)
1029public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides)
1087private static void DrawBorderComplex(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
1174Rectangle bounds,
1211public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1233Rectangle rectangle,
1259public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1287public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1305public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds)
1349private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1371Rectangle rectangle,
1380Rectangle offsetRectangle = new(
1425public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
1432public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor)
1435internal static void DrawHighContrastFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1438internal static void DrawBlackWhiteFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1441private static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color color, bool highContrast, bool blackAndWhite = false)
1511public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled)
1523Rectangle fillRect = new(
1538public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor)
1583Rectangle destination,
1605internal static void DrawImageReplaceColor(Graphics g, Image image, Rectangle dest, Color oldColor, Color newColor)
1625internal static void DrawImageDisabled(Graphics graphics, Image image, Rectangle imageBounds, bool unscaledImage)
1691internal static void EnforceHeaderCellDividerContrast(Graphics graphics, Rectangle bounds)
1708public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary)
1726public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph)
1735Rectangle rectangle,
1771public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1788public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1810public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style)
1870public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state)
1892Rectangle bounds = new(x, y, width, height);
1930Rectangle outsideRect,
1931Rectangle insideRect,
1947public static void DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds)
2041Rectangle layoutRectangle,
2058Rectangle layoutRectangle,
2081public static void DrawVisualStyleBorder(Graphics graphics, Rectangle bounds)
2095public static void FillReversibleRectangle(Rectangle rectangle, Color backColor)
2376Rectangle bound)
2409internal static void PaintTableCellBorder(TableLayoutPanelCellBorderStyle borderStyle, Graphics g, Rectangle bound)
System\Windows\Forms\Rendering\ControlPaint_ModernControlButtonRenderer.cs (7)
22Rectangle bounds,
128Rectangle focusRect = bounds;
152Rectangle bounds,
213private static int ScaleSymbolSize(Rectangle bounds)
232private static void DrawUpDownArrows(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
260private static void DrawLeftRightArrows(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
288private static void DrawEllipseSymbol(Graphics graphics, Brush brush, int centerX, int centerY, Rectangle bounds)
System\Windows\Forms\Rendering\TextRenderer.cs (18)
149public static void DrawText(IDeviceContext dc, string? text, Font? font, Rectangle bounds, Color foreColor)
158/// <param name="bounds">The <see cref="Rectangle"/> that represents the bounds of the text.</param>
165Rectangle bounds,
173Rectangle bounds,
185/// <param name="bounds">The <see cref="Rectangle"/> that represents the bounds of the text.</param>
193Rectangle bounds,
202Rectangle bounds,
214/// <param name="bounds">The <see cref="Rectangle"/> that represents the bounds of the text.</param>
225Rectangle bounds,
241Rectangle bounds,
254/// <param name="bounds">The <see cref="Rectangle"/> that represents the bounds of the text.</param>
266Rectangle bounds,
293Rectangle bounds,
316Rectangle bounds,
325Rectangle bounds,
349Rectangle bounds,
359Rectangle bounds,
392/// <see cref="DrawText(IDeviceContext, ReadOnlySpan{char}, Font?, Rectangle, Color, TextFormatFlags)"/>
System\Windows\Forms\Scrolling\ScrollBarRenderer.cs (10)
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)
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (33)
211public void DrawBackground(IDeviceContext dc, Rectangle bounds)
219internal unsafe void DrawBackground(HDC dc, Rectangle bounds, HWND hwnd = default)
240public void DrawBackground(IDeviceContext dc, Rectangle bounds, Rectangle clipRectangle)
248internal unsafe void DrawBackground(HDC dc, Rectangle bounds, Rectangle clipRectangle, HWND hwnd)
267public Rectangle DrawEdge(IDeviceContext dc, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects)
275internal unsafe Rectangle DrawEdge(HDC dc, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects)
299public void DrawImage(Graphics g, Rectangle bounds, Image image)
314public void DrawImage(Graphics g, Rectangle bounds, ImageList imageList, int imageIndex)
335public void DrawParentBackground(IDeviceContext dc, Rectangle bounds, Control childControl)
355public void DrawText(IDeviceContext dc, Rectangle bounds, string? textToDraw)
363public void DrawText(IDeviceContext dc, Rectangle bounds, string? textToDraw, bool drawDisabled)
371public void DrawText(IDeviceContext dc, Rectangle bounds, string? textToDraw, bool drawDisabled, TextFormatFlags flags)
379internal void DrawText(HDC dc, Rectangle bounds, string? textToDraw, bool drawDisabled, TextFormatFlags flags)
405public Rectangle GetBackgroundContentRectangle(IDeviceContext dc, Rectangle bounds)
413internal Rectangle GetBackgroundContentRectangle(HDC dc, Rectangle bounds)
417return Rectangle.Empty;
427public Rectangle GetBackgroundExtent(IDeviceContext dc, Rectangle contentBounds)
433return Rectangle.Empty;
446public unsafe Region? GetBackgroundRegion(IDeviceContext dc, Rectangle bounds)
598public unsafe Size GetPartSize(IDeviceContext dc, Rectangle bounds, ThemeSizeType type)
658public unsafe Rectangle GetTextExtent(IDeviceContext dc, string textToDraw, TextFormatFlags flags)
681public unsafe Rectangle GetTextExtent(IDeviceContext dc, Rectangle bounds, string textToDraw, TextFormatFlags flags)
716public HitTestCode HitTestBackground(IDeviceContext dc, Rectangle backgroundRectangle, Point pt, HitTestOptions options)
738public HitTestCode HitTestBackground(Graphics g, Rectangle backgroundRectangle, Region region, Point pt, HitTestOptions options)
750public HitTestCode HitTestBackground(IDeviceContext dc, Rectangle backgroundRectangle, IntPtr hRgn, Point pt, HitTestOptions options)