System\Windows\Forms\Control.cs (42)
1006public Rectangle Bounds
1162public Rectangle ClientRectangle => new Rectangle(0, 0, _clientWidth, _clientHeight);
1647public virtual Rectangle DisplayRectangle
4474Rectangle originalBounds;
4492Rectangle parentClient = _parent.ClientRectangle;
4899public void DrawToBitmap(Bitmap bitmap, Rectangle targetBounds)
5186internal virtual Rectangle ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight)
5194Rectangle newBounds = new(suggestedX, suggestedY, 0, 0)
5274protected virtual Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified)
5504private protected virtual IList<Rectangle> GetNeighboringToolsRectangles()
5836OnInvalidated(new InvalidateEventArgs(Rectangle.Ceiling(region.GetBounds(graphics))));
5887public void Invalidate(Rectangle rc)
5898public unsafe void Invalidate(Rectangle rc, bool invalidateChildren)
6515protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
7916Rectangle cliprect = e.InvalidRect;
7919cliprect = Rectangle.Intersect(ClientRectangle, cliprect);
8072internal void PaintBackground(PaintEventArgs e, Rectangle rectangle) =>
8075internal void PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset = default)
8126private static void PaintBackColor(PaintEventArgs e, Rectangle rectangle, Color backColor)
8156Rectangle clientRectangle = ClientRectangle;
8157Rectangle rectangle = clientRectangle;
8185internal unsafe void PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region? transparentRegion = null)
8225Rectangle shift = new(-Left, -Top, parent.Width, parent.Height);
8228Rectangle newClipRect = new(
8741private protected virtual void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds)
8755Rectangle clientBounds = new(clientOffset, ClientSize);
9290public Rectangle RectangleToClient(Rectangle r)
9300public Rectangle RectangleToScreen(Rectangle r)
9711Rectangle rawScaledBounds = GetScaledBounds(Bounds, factor, specified);
10069Rectangle adjustedBounds = ApplyBoundsConstraints(x, y, width, height);
11728Rectangle clip;
11769Rectangle band = ClientRectangle;
12612void IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
12716Rectangle IKeyboardToolTip.GetNativeScreenRectangle() => GetToolNativeScreenRectangle();
12718IList<Rectangle> IKeyboardToolTip.GetNeighboringToolsRectangles() => GetNeighboringToolsRectangles();
12745private IList<Rectangle> GetOwnNeighboringToolsRectangles()
12750return Array.Empty<Rectangle>();
12753List<Rectangle> neighboringControlsRectangles = new(4);
12783internal virtual Rectangle GetToolNativeScreenRectangle()
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (20)
97internal static void DrawDitheredFill(Graphics g, Color color1, Color color2, Rectangle bounds)
103protected void Draw3DBorder(IDeviceContext deviceContext, Rectangle bounds, ColorData colors, bool raised)
129private void Draw3DBorderHighContrastRaised(IDeviceContext deviceContext, ref Rectangle bounds, ColorData colors)
187private static void Draw3DBorderNormal(IDeviceContext deviceContext, ref Rectangle bounds, ColorData colors)
232private void Draw3DBorderRaised(IDeviceContext deviceContext, ref Rectangle bounds, ColorData colors)
294protected internal static void Draw3DLiteBorder(IDeviceContext deviceContext, Rectangle r, ColorData colors, bool up)
324Rectangle bounds,
332Rectangle left = new(bounds.X, bounds.Y, size, bounds.Height);
333Rectangle right = new(bounds.X + bounds.Width - size, bounds.Y, size, bounds.Height);
334Rectangle top = new(bounds.X + size, bounds.Y, bounds.Width - size * 2, size);
335Rectangle bottom = new(bounds.X + size, bounds.Y + bounds.Height - size, bounds.Width - size * 2, size);
356internal static void DrawFlatFocus(IDeviceContext deviceContext, Rectangle r, Color color)
366private void DrawFocus(Graphics g, Rectangle r)
374internal virtual void DrawImageCore(Graphics graphics, Image image, Rectangle imageBounds, Point imageStart, LayoutData layout)
380Rectangle bounds = new(
423internal static void DrawDefaultBorder(IDeviceContext deviceContext, Rectangle r, Color color, bool isDefault)
453Rectangle r = layout.TextBounds;
514internal void PaintButtonBackground(PaintEventArgs e, Rectangle bounds, Brush? background)
533Rectangle maxFocus = layout.Focus;
556Rectangle 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\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)
26private static void DrawBackground(Graphics g, Rectangle bounds, ComboBoxState state)
37Rectangle fillRect = t_visualStyleRenderer.GetBackgroundContentRectangle(g, bounds);
48public static void DrawTextBox(Graphics g, Rectangle bounds, ComboBoxState state)
58public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, ComboBoxState state)
66public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, ComboBoxState state)
74public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, TextFormatFlags flags, ComboBoxState state)
78Rectangle textBounds = t_visualStyleRenderer.GetBackgroundContentRectangle(g, bounds);
86public static void DrawTextBox(Graphics g, Rectangle bounds, string? comboBoxText, Font? font, Rectangle textBounds, TextFormatFlags flags, ComboBoxState state)
98public static void DrawDropDownButton(Graphics g, Rectangle bounds, ComboBoxState state)
111internal 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);
2739Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data);
2742clip = Rectangle.Union(_layout.TopLeftHeader, clip);
2774Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data);
2968private Rectangle CalcColRelocationFeedbackRect(int mouseX)
2970Rectangle r, inside = _layout.ColumnHeaders;
2973inside = Rectangle.Union(_layout.TopLeftHeader, inside);
3000private Rectangle CalcColResizeFeedbackRect(int mouseX)
3002Rectangle inside = _layout.Data;
3003Rectangle r = new(
3021private Rectangle CalcRowResizeFeedbackRect(int mouseY)
3023Rectangle inside = _layout.Data;
3024Rectangle r = new(
3377private void CaptureMouse(Rectangle cursorClip)
4362Rectangle oldResizeRect = _layout.ResizeBoxRect;
4369Rectangle inside = newLayout.Inside;
4382Rectangle insideLeft = inside;
4387Rectangle colHeaders = insideLeft;
4396newLayout.ColumnHeaders = Rectangle.Empty;
4401Rectangle rowHeaders = insideLeft;
4418Rectangle topLeft;
4419Rectangle colHeaders = newLayout.ColumnHeaders;
4438newLayout.TopLeftHeader = Rectangle.Empty;
4443newLayout.RowHeaders = Rectangle.Empty;
4444newLayout.TopLeftHeader = Rectangle.Empty;
5425private RECT[]? CreateScrollableRegion(Rectangle scroll)
5485ref Rectangle rectScrollingArea,
5631Rectangle r = CalcColRelocationFeedbackRect(mouseX);
5635Rectangle rectInsertionBar = new(0, _layout.ColumnHeaders.Top, InsertionBarWidth, _layout.ColumnHeaders.Height);
5688Rectangle r = CalcColResizeFeedbackRect(mouseX);
5698Rectangle r = CalcRowResizeFeedbackRect(mouseY);
5702private void DrawShadowRect(Rectangle r)
5723private void DrawSplitBar(Rectangle r)
6071Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
6424Rectangle rectScreen = Screen.FromControl(this).WorkingArea;
6817internal Rectangle GetCellAdjustedDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow)
6819Rectangle rect = GetCellDisplayRectangle(columnIndex, rowIndex, cutOverflow);
7043public Rectangle GetCellDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow)
7045Rectangle rowRect;
7046Rectangle columnRect;
8193public Rectangle GetColumnDisplayRectangle(int columnIndex, bool cutOverflow)
8201private Rectangle GetColumnDisplayRectanglePrivate(int columnIndex, bool cutOverflow)
8207return Rectangle.Empty;
8210Rectangle data = _layout.Data;
8304Rectangle columnRect = RightToLeftInternal
8317return Rectangle.Empty;
8324Rectangle data = _layout.Data;
8564Rectangle rectScrollingArea = _layout.Data;
8581rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.RowHeaders);
8673rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.ColumnHeaders);
9023public Rectangle GetRowDisplayRectangle(int rowIndex, bool cutOverflow)
9031private Rectangle GetRowDisplayRectanglePrivate(int rowIndex, bool cutOverflow)
9037return Rectangle.Empty;
9040Rectangle data = _layout.Data;
9091Rectangle rowRect = new(data.X, cy, data.Width, displayHeight);
9105return Rectangle.Empty;
9110Rectangle data = _layout.Data;
9794Rectangle cellDisplayRect = GetCellAdjustedDisplayRectangle(columnIndex, rowIndex, true);
9819Rectangle columnDisplayRect = GetColumnDisplayRectanglePrivate(columnIndex, true);
9863Rectangle rowDisplayRect = GetRowDisplayRectanglePrivate(rowIndex, true);
9896Rectangle rowDisplayRect, data;
10431Rectangle lastSplitBarRect = CalcRowResizeFeedbackRect(_lastRowSplitBar);
10492Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
10499Rectangle lastSplitBarRect = CalcColResizeFeedbackRect(_lastColSplitBar);
13450Invalidate(Rectangle.Union(_layout.ColumnHeaders, _layout.Data));
13913Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
14490Rectangle rightArea = _layout.Data;
14493rightArea = Rectangle.Union(rightArea, _layout.ColumnHeaders);
16684Rectangle clipRect = e.ClipRectangle;
16685Rectangle gridRect = GetGridRectangle();
16689clipRect = Rectangle.Union(clipRect, CalcRowResizeFeedbackRect(_currentRowSplitBar));
16693clipRect = Rectangle.Union(clipRect, CalcColResizeFeedbackRect(_currentColSplitBar));
16741private Rectangle GetGridRectangle()
16743Rectangle gridRect = _layout.Data;
16746gridRect = Rectangle.Union(gridRect, _layout.RowHeaders);
16760gridRect = Rectangle.Union(gridRect, _layout.ColumnHeaders);
16775private Rectangle GetGridFocusRectangle()
16777Rectangle focusRect = GetGridRectangle();
16789Rectangle focusRect = GetGridFocusRectangle();
16825private void InvalidateRectangleEdges(Rectangle rect)
16828Rectangle edge = rect;
17441Rectangle right;
17442Rectangle bottom;
17443Rectangle oldClientRectangle = _layout.ClientRectangle;
17444Rectangle oldGridFocusRectangle = GetGridFocusRectangle();
17461Rectangle newClientRectangle = _normalClientRectangle;
17462Rectangle newGridFocusRectangle = DisplayRectangle;
18190Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.RowHeaders));
18823Rectangle rect = Screen.GetBounds(pt);
19207protected virtual void PaintBackground(Graphics graphics, Rectangle clipBounds, Rectangle gridBounds)
19210Rectangle rcBelowRows = gridBounds;
19236Rectangle rcNextRows = gridBounds;
19278private void PaintBorder(Graphics g, Rectangle clipRect, Rectangle bounds)
19290Rectangle edge = new(0, 0, bounds.Width, borderWidth);
19339private void PaintColumnHeaders(Graphics g, Rectangle clipBounds, bool singleBorderAdded)
19343Rectangle bandBounds, cellBounds;
19408Rectangle scrollingBounds = bandBounds;
19422Rectangle rowRect = bandBounds;
19493Rectangle gridBounds,
19494Rectangle clipRect,
19498Rectangle rc = gridBounds;
19513Rectangle columnHeadersClip = _layout.ColumnHeaders;
19557Rectangle boundingRect,
19558Rectangle clipRect,
19563Rectangle rowBounds;
19685Rectangle cellBounds = _layout.TopLeftHeader;
19813Rectangle editingZone = _layout.Data;
19829Rectangle cellBounds = new(leftEdge, GetRowYFromIndex(_ptCurrentCell.Y),
19831Rectangle cellClip = cellBounds;
25601Cursor.Clip = Rectangle.Empty;
25872Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
26337Rectangle rowsRect = _layout.Data;
26340rowsRect = Rectangle.Union(rowsRect, _layout.RowHeaders);
28957Rectangle rectUpper = GetCellAdjustedDisplayRectangle(-1, rowIndexStart, true);
28958Rectangle rectLower = GetCellAdjustedDisplayRectangle(-1, rowIndexEnd, true);
28968Invalidate(Rectangle.Union(rectUpper, rectLower));
29007Rectangle bottomArea = _layout.Data;
29010bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
29082Rectangle bottomArea = _layout.Data;
29085bottomArea = 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(
217protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
227return Rectangle.Empty;
234out Rectangle cellBounds);
236Rectangle errorIconBounds = PaintPrivate(
253Rectangle errorIconBoundsDebug = PaintPrivate(
293Rectangle borderWidthsRect = StdBorderWidths;
309Rectangle rectThemeMargins = GetThemeMargins(graphics);
411private static Rectangle GetThemeMargins(Graphics g)
415Rectangle rectCell = new(0, 0, DATAGRIDVIEWBUTTONCELL_themeMargin, DATAGRIDVIEWBUTTONCELL_themeMargin);
416Rectangle rectContent = DataGridViewButtonCellRenderer.DataGridViewButtonRenderer.GetBackgroundContentRectangle(g, rectCell);
601Rectangle clipBounds,
602Rectangle cellBounds,
638private Rectangle PaintPrivate(
640Rectangle clipBounds,
641Rectangle cellBounds,
665Rectangle resultBounds;
678Rectangle valBounds = cellBounds;
679Rectangle borderWidths = BorderWidths(advancedBorderStyle);
687return Rectangle.Empty;
711Rectangle errorBounds = valBounds;
870resultBounds = Rectangle.Empty;
876resultBounds = Rectangle.Empty;
890ControlPaint.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);
1392Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.Width - 1, checkBoxSize.Height - 1);
1551resultBounds = Rectangle.Empty;
1557resultBounds = 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(
834protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
844return Rectangle.Empty;
854ComputeBorderStyleCellStateAndCellBounds(rowIndex, out DataGridViewAdvancedBorderStyle dgvabsEffective, out DataGridViewElementStates cellState, out Rectangle cellBounds);
856Rectangle errorIconBounds = PaintPrivate(
866out Rectangle dropDownButtonRect, // not used
874Rectangle errorIconBoundsDebug = PaintPrivate(
1176Rectangle borderWidthsRect = StdBorderWidths;
1331Rectangle rectBottomSection = DataGridView.GetCellDisplayRectangle(ColumnIndex, rowIndex, true);
1763Rectangle cellBounds = DataGridView.GetCellDisplayRectangle(OwningColumn.Index, rowIndex, cutOverflow: false);
1774Rectangle dropDownButtonRect;
1814Rectangle clipBounds,
1815Rectangle cellBounds,
1855private Rectangle PaintPrivate(
1857Rectangle clipBounds,
1858Rectangle cellBounds,
1865out Rectangle dropDownButtonRect,
1883Rectangle resultBounds = Rectangle.Empty;
1884dropDownButtonRect = Rectangle.Empty;
1912Rectangle borderWidths = BorderWidths(advancedBorderStyle);
1913Rectangle valBounds = cellBounds;
2008Rectangle dropRect;
2208Rectangle errorBounds = valBounds;
2209Rectangle textBounds = Rectangle.Inflate(valBounds, -2, -2);
2257Rectangle focusBounds = textBounds;
2270Rectangle focusBounds = textBounds;
2356return Rectangle.Empty;
2369resultBounds = 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(
326protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
336return Rectangle.Empty;
343out Rectangle cellBounds);
345Rectangle errorBounds = PaintPrivate(graphics,
369Rectangle errorBoundsDebug = PaintPrivate(graphics,
402Rectangle borderWidthsRect = StdBorderWidths;
600Rectangle clipBounds,
601Rectangle cellBounds,
642private Rectangle PaintPrivate(
644Rectangle clipBounds,
645Rectangle cellBounds,
667Rectangle resultBounds = Rectangle.Empty;
674Rectangle borderWidths = BorderWidths(advancedBorderStyle);
675Rectangle valBounds = cellBounds;
720Rectangle errorBounds = valBounds;
786Rectangle cellBounds,
787Rectangle cellClip,
794Rectangle 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)
873protected Rectangle CalcImageRenderBounds(Image image, Rectangle r, ContentAlignment align)
966private void DrawImage(PaintEventArgs e, Image image, Rectangle r, ContentAlignment align)
982protected void DrawImage(Graphics g, Image image, Rectangle r, ContentAlignment align)
985private void DrawImageInternal(Graphics g, Image image, Rectangle r, ContentAlignment align)
987Rectangle loc = CalcImageRenderBounds(image, r, align);
1254Rectangle face = LayoutUtils.DeflateRect(ClientRectangle, Padding);
1271Rectangle clientRect = ClientRectangle;
1351private protected override void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds)
1435Rectangle 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)
2627Rectangle itemBounds = GetItemRectOrEmpty(itemIndex);
2713Rectangle subItemBounds = GetSubItemRect(itemIndex, nmcd->iSubItem);
3232Rectangle itemBounds = lvi.Bounds;
3238Rectangle iconBounds = GetItemRect(lvi.Index, ItemBoundsPortion.Icon);
3567public Rectangle GetItemRect(int index) => GetItemRect(index, 0);
3572public Rectangle GetItemRect(int index, ItemBoundsPortion portion)
3582return Rectangle.Empty;
3595: (Rectangle)itemrect;
3602private Rectangle GetItemRectOrEmpty(int index)
3606return Rectangle.Empty;
3611return Rectangle.Empty;
3620? Rectangle.Empty
3621: (Rectangle)itemrect;
3627internal Rectangle GetSubItemRect(int itemIndex, int subItemIndex)
3632internal Rectangle GetSubItemRect(int itemIndex, int subItemIndex, ItemBoundsPortion portion)
3636return Rectangle.Empty;
3658return Rectangle.Empty;
3672: (Rectangle)itemrect;
4999Rectangle rectInvalid = Items[startIndex].Bounds;
5002rectInvalid = Rectangle.Union(rectInvalid, Items[index].Bounds);
5007rectInvalid = Rectangle.Union(rectInvalid, Items[startIndex - 1].Bounds);
5018rectInvalid = Rectangle.Union(rectInvalid, Items[endIndex + 1].Bounds);
6899Rectangle rect = new(0, 0, Size.Width - 1, Size.Height - 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (25)
46private Rectangle _outlineRect = Rectangle.Empty;
649public Rectangle OutlineRectangle
675_outlineRect = Rectangle.Empty;
1512Rectangle rect,
1513Rectangle clipRect,
1577Rectangle textRect = new(stringX, rect.Y + 1, maxSpace, rect.Height - 1);
1579if (!Rectangle.Intersect(textRect, clipRect).IsEmpty)
1630private void PaintOutlineGlyph(Graphics g, Rectangle r)
1641_outlineRect = Rectangle.Empty;
1656_outlineRect = Rectangle.Empty;
1664void PaintOutlineWithExplorerTreeStyle(Graphics g, Rectangle r, HWND hwnd)
1667Rectangle outline = Rectangle.Intersect(r, OutlineRectangle);
1707Rectangle rectangle,
1729void PaintOutlineWithClassicStyle(Graphics g, Rectangle r)
1732Rectangle outline = Rectangle.Intersect(r, OutlineRectangle);
1790Rectangle rect,
1791Rectangle clipRect,
1845Rectangle rectPaint = new(
1851if (!Rectangle.Intersect(rectPaint, clipRect).IsEmpty)
1888if (Rectangle.Intersect(rect, clipRect).IsEmpty)
1905Rectangle textRectangle = new(
2002Rectangle outlineRect = OutlineRectangle;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (44)
82private Rectangle _lastClientRect = Rectangle.Empty;
455Rectangle rect = GetRectangle(_selectedRow, RowLabel);
591internal Rectangle AccessibilityGetGridEntryBounds(GridEntry gridEntry)
596return Rectangle.Empty;
599Rectangle rect = GetRectangle(row, RowValue | RowLabel);
605Rectangle parent = gridEntry.OwnerGrid.GridViewAccessibleObject.Bounds;
611return Rectangle.Empty;
675private static void AdjustOrigin(Graphics g, Point newOrigin, ref Rectangle r)
876private void CommonEditorUse(Control control, Rectangle targetRectangle)
880Rectangle rectCur = control.Bounds;
883Rectangle clientRect = ClientRectangle;
889targetRectangle = Rectangle.Intersect(clientRect, targetRectangle);
903targetRectangle = Rectangle.Empty;
1090Rectangle rect,
1093Rectangle clipRect)
1103clipRect = Rectangle.Intersect(rect, clipRect);
1148private void DrawValue(Graphics g, int row, Rectangle clipRect)
1156Rectangle rect = GetRectangle(row, RowValue);
1158clipRect = Rectangle.Intersect(clipRect, rect);
1363Rectangle r = GetRectangle(row, rowValue ? RowValue : RowLabel);
1417Rectangle rect = GetRectangle(_selectedRow, RowValue);
1420Rectangle rectScreen = Screen.FromControl(EditTextBox).WorkingArea;
1879public Rectangle GetRectangle(int row, int flRow)
1881Rectangle rect = new(0, 0, 0, 0);
1967Rectangle rect = ClientRectangle;
1972Rectangle boundsScroll = ScrollBar.Bounds;
2000Rectangle rect;
2115Rectangle r = ClientRectangle;
2295Rectangle drawBounds = e.Bounds;
2359Rectangle clearRect = new(1, 1, Size.Width - 2, Size.Height - 2);
2981Rectangle r = GetRectangle(pos.Y, RowLabel);
3055Rectangle itemRect = GetRectangle(point.Y, point.X);
3261Rectangle clipRect = e.ClipRectangle;
3327Rectangle rect = GetRectangle(i, RowLabel);
3350Rectangle clearRect = new(1, yPosition, Size.Width - 2, Size.Height - yPosition - 1);
3576Rectangle newRect = ClientRectangle;
3577int yDelta = _lastClientRect == Rectangle.Empty ? 0 : newRect.Height - _lastClientRect.Height;
3583Rectangle rectInvalidate = new(_lastClientRect.Width - 1, 0, newRect.Width - _lastClientRect.Width + 1, _lastClientRect.Height);
3589Rectangle rectInvalidate = new(0, _lastClientRect.Height - 1, _lastClientRect.Width, newRect.Height - _lastClientRect.Height + 1);
3777internal static void PositionTooltip(Control parent, GridToolTip toolTip, Rectangle itemRect)
4306Rectangle rect = GetRectangle(row, RowValue);
4325Rectangle rectTarget = new(
5266Rectangle 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;
347Rectangle bounds = new(Point.Empty, item?.Size ?? Size.Empty);
355Rectangle fillRect = item is not null && item.Selected ? item.ContentRectangle : bounds;
417Rectangle bounds = new(Point.Empty, toolStrip.Size);
454Rectangle edging;
483Rectangle bounds = e.GripBounds;
498Rectangle[] shadowRects = new Rectangle[numRectangles];
546Rectangle bounds = new(Point.Empty, item.Size);
592Rectangle fillRect = bounds;
649Rectangle fillRect = bounds;
697Rectangle bounds = e.AffectedBounds;
743Rectangle imageRect = e.ImageRectangle;
758if (imageRect != Rectangle.Empty && image is not null)
846Rectangle bounds = new(Point.Empty, toolStrip.Size);
860Rectangle topLeftParentHorizontalPixels = new(topLeft, s_onePix);
861Rectangle bottomLeftParentHorizontalPixels = new(bottomLeft, new Size(2, 1));
862Rectangle bottomLeftParentVerticalPixels = new(bottomLeft.X, bottomLeft.Y - 1, 1, 2);
865Rectangle bottomRightHorizontalPixels = new(bottomRight.X - 1, bottomRight.Y, 2, 1);
866Rectangle bottomRightVerticalPixels = new(bottomRight.X, bottomRight.Y - 1, 1, 2);
869Rectangle topRightHorizontalPixels, topRightVerticalPixels;
953private static void FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, int firstGradientWidth, int secondGradientWidth, LinearGradientMode mode, bool flipHorizontal)
960Rectangle endGradient = bounds;
961Rectangle beginGradient = bounds;
1045Rectangle bounds = ScaleHelper.IsScalingRequired
1079private void RenderPressedGradient(Graphics g, Rectangle bounds)
1108Rectangle bounds = new(Point.Empty, item.Size);
1110Rectangle fillRect = item.Selected ? item.ContentRectangle : bounds;
1141Rectangle gradientBounds = new(Point.Empty, parent.Size);
1155Rectangle gradientBounds = new(Point.Empty, control.Size);
1174Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1183Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1195Rectangle bounds = new(Point.Empty, toolStripDropDown.Size);
1217Rectangle overflowBoundsFill = new(Point.Empty, e.Item.Size);
1218Rectangle bounds = overflowBoundsFill;
1321Rectangle fillRect = new(overflowBoundsFill.X - 1, 0, 1, 1);
1338Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
1340Rectangle displayRect = toolStrip.DisplayRectangle;
1354Rectangle topLeftShadowRect = new(topLeft, s_onePix);
1358Rectangle topLeftShadowRect2 = new(topLeft, s_onePix);
1362Rectangle topRightShadowRect = new(topRight, s_onePix);
1366Rectangle topRightShadowRect2 = topRightShadowRect;
1370Rectangle[] paintRects = [topLeftShadowRect, topLeftShadowRect2, topRightShadowRect, topRightShadowRect2];
1377paintRects[i] = Rectangle.Empty;
1396Rectangle otherBottom = new(bottomLeft.X, bottomLeft.Y - 2, 1, 1);
1404private void RenderSelectedButtonFill(Graphics g, Rectangle bounds)
1428private void RenderCheckedButtonFill(Graphics g, Rectangle bounds)
1452private void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical)
1540private void RenderPressedButtonFill(Graphics g, Rectangle bounds)
1567Rectangle bounds = new(Point.Empty, item.Size);
1570Rectangle fillRect = (item.Selected) ? item.ContentRectangle : bounds;
1646private 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)
74private static void FillBackground(Graphics g, Rectangle bounds, Color backColor)
187Rectangle bounds = e.AffectedBounds;
238Rectangle bounds = toolStrip.ClientRectangle;
279Rectangle bounds = new(Point.Empty, e.GripBounds.Size);
421Rectangle bounds = new(Point.Empty, item.Size);
444Rectangle fillRect = new(Point.Empty, item.Size);
545Rectangle splitButtonBounds = splitButton.ButtonBounds;
562Rectangle fillRect = splitButton.ContentRectangle;
582var clientBounds = item.ClientBounds;
591Rectangle splitButtonButtonRect = splitButton.ButtonBounds;
595Rectangle bounds = new(Point.Empty, splitButton.Size);
598Rectangle fillRect = splitButton.Selected ? splitButton.ContentRectangle : bounds;
614Rectangle dropDownRect = splitButton.DropDownButtonBounds;
660var bounds = item.ClientBounds;
670Rectangle fillRect = item.ContentRectangle;
688private static void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical)
743private static void RenderSmall3DBorderInternal(Graphics g, Rectangle bounds, ToolBarState state, bool rightToLeft)
792Rectangle 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)
453internal override Rectangle ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight)
518Rectangle editBounds = _upDownEdit.Bounds;
525Rectangle bounds = ClientRectangle;
526Rectangle clipBounds = e.ClipRectangle;
531Rectangle clipLeft = new(bounds.Left, bounds.Top, border, bounds.Height);
532Rectangle clipTop = new(bounds.Left, bounds.Top, bounds.Width, border);
533Rectangle clipRight = new(bounds.Right - border, bounds.Top, border, bounds.Height);
534Rectangle clipBottom = new(bounds.Left, bounds.Bottom - border, bounds.Width, border);
547Rectangle backRect = editBounds;
559Rectangle backRect = editBounds;
834Rectangle upDownEditBounds = Rectangle.Empty;
835Rectangle upDownButtonsBounds = Rectangle.Empty;
837Rectangle 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);
681Rectangle preClientUpdateRestoredWindowBounds = _restoredWindowBounds;
895public Rectangle DesktopBounds
899Rectangle screen = SystemInformation.WorkingArea;
900Rectangle bounds = Bounds;
922Rectangle screen = SystemInformation.WorkingArea;
1160protected Rectangle MaximizedBounds
1162get => Properties.GetValueOrDefault<Rectangle>(s_propMaximizedBounds);
1316Rectangle bounds = Bounds;
1667public Rectangle RestoreBounds
3047Rectangle bounds = Bounds;
3650Rectangle clientRect = mdiclient is null ? Rectangle.Empty : mdiclient.ClientRectangle;
3672Rectangle screenRect = desktop.WorkingArea;
3857Rectangle screenRect = desktop.WorkingArea;
3913Rectangle screenRect = desktop.WorkingArea;
5131protected override Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified)
5323Rectangle workingArea = SystemInformation.WorkingArea;
5332Rectangle workingArea = SystemInformation.WorkingArea;
6762Rectangle maximizedBounds = MaximizedBounds;
6775private 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 (55)
70internal static Rectangle CalculateBackgroundImageRectangle(Rectangle bounds, Size imageSize, ImageLayout imageLayout)
72Rectangle result = bounds;
391internal static void PrintBorder(Graphics graphics, Rectangle bounds, BorderStyle style, Border3DStyle b3dStyle)
416Rectangle bounds,
417Rectangle clipRect,
442Rectangle imageRectangle = CalculateBackgroundImageRectangle(bounds, backgroundImage.Size, backgroundImageLayout);
471Rectangle imageRect = imageRectangle;
473Rectangle partOfImageToDraw = new(Point.Empty, imageRect.Size);
485Rectangle imageRect = imageRectangle;
487Rectangle partOfImageToDraw = new(
518public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
546Rectangle bounds,
565Rectangle bounds,
973public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
983public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style)
994public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides)
1052private static void DrawBorderComplex(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
1139Rectangle bounds,
1176public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1198Rectangle rectangle,
1224public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1252public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1270public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds)
1314private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1336Rectangle rectangle,
1345Rectangle offsetRectangle = new(
1393public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
1400public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor)
1403internal static void DrawHighContrastFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1406internal static void DrawBlackWhiteFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1409private static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color color, bool highContrast, bool blackAndWhite = false)
1479public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled)
1491Rectangle fillRect = new(
1506public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor)
1554Rectangle destination,
1576internal static void DrawImageReplaceColor(Graphics g, Image image, Rectangle dest, Color oldColor, Color newColor)
1596internal static void DrawImageDisabled(Graphics graphics, Image image, Rectangle imageBounds, bool unscaledImage)
1662internal static void EnforceHeaderCellDividerContrast(Graphics graphics, Rectangle bounds)
1679public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary)
1697public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph)
1706Rectangle rectangle,
1742public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1759public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1781public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style)
1841public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state)
1866Rectangle outsideRect,
1867Rectangle insideRect,
1883public static void DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds)
1977Rectangle layoutRectangle,
1994Rectangle layoutRectangle,
2017public static void DrawVisualStyleBorder(Graphics graphics, Rectangle bounds)
2031public static void FillReversibleRectangle(Rectangle rectangle, Color backColor)
2318Rectangle bound)
2351internal static void PaintTableCellBorder(TableLayoutPanelCellBorderStyle borderStyle, Graphics g, Rectangle bound)
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)