System\Windows\Forms\Control.cs (42)
1008public Rectangle Bounds
1164public Rectangle ClientRectangle => new Rectangle(0, 0, _clientWidth, _clientHeight);
1649public virtual Rectangle DisplayRectangle
4476Rectangle originalBounds;
4494Rectangle parentClient = _parent.ClientRectangle;
4901public void DrawToBitmap(Bitmap bitmap, Rectangle targetBounds)
5188internal virtual Rectangle ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight)
5196Rectangle newBounds = new(suggestedX, suggestedY, 0, 0)
5276protected virtual Rectangle GetScaledBounds(Rectangle bounds, SizeF factor, BoundsSpecified specified)
5506private protected virtual IList<Rectangle> GetNeighboringToolsRectangles()
5838OnInvalidated(new InvalidateEventArgs(Rectangle.Ceiling(region.GetBounds(graphics))));
5889public void Invalidate(Rectangle rc)
5900public unsafe void Invalidate(Rectangle rc, bool invalidateChildren)
6517protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
7918Rectangle cliprect = e.InvalidRect;
7921cliprect = Rectangle.Intersect(ClientRectangle, cliprect);
8074internal void PaintBackground(PaintEventArgs e, Rectangle rectangle) =>
8077internal void PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset = default)
8128private static void PaintBackColor(PaintEventArgs e, Rectangle rectangle, Color backColor)
8158Rectangle clientRectangle = ClientRectangle;
8159Rectangle rectangle = clientRectangle;
8187internal unsafe void PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region? transparentRegion = null)
8227Rectangle shift = new(-Left, -Top, parent.Width, parent.Height);
8230Rectangle newClipRect = new(
8743private protected virtual void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds)
8757Rectangle clientBounds = new(clientOffset, ClientSize);
9292public Rectangle RectangleToClient(Rectangle r)
9302public Rectangle RectangleToScreen(Rectangle r)
9713Rectangle rawScaledBounds = GetScaledBounds(Bounds, factor, specified);
10071Rectangle adjustedBounds = ApplyBoundsConstraints(x, y, width, height);
11730Rectangle clip;
11771Rectangle band = ClientRectangle;
12614void IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
12718Rectangle IKeyboardToolTip.GetNativeScreenRectangle() => GetToolNativeScreenRectangle();
12720IList<Rectangle> IKeyboardToolTip.GetNeighboringToolsRectangles() => GetNeighboringToolsRectangles();
12747private IList<Rectangle> GetOwnNeighboringToolsRectangles()
12752return Array.Empty<Rectangle>();
12755List<Rectangle> neighboringControlsRectangles = new(4);
12785internal 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)
2432Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data);
2435clip = Rectangle.Union(_layout.TopLeftHeader, clip);
2456Rectangle cursorClip = _layout.ColumnHeaders;
2536private Rectangle GetResizeClipRectangle(int columnIndex)
2538Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data);
2740Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data);
2743clip = Rectangle.Union(_layout.TopLeftHeader, clip);
2775Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data);
2969private Rectangle CalcColRelocationFeedbackRect(int mouseX)
2971Rectangle r, inside = _layout.ColumnHeaders;
2974inside = Rectangle.Union(_layout.TopLeftHeader, inside);
3001private Rectangle CalcColResizeFeedbackRect(int mouseX)
3003Rectangle inside = _layout.Data;
3004Rectangle r = new(
3022private Rectangle CalcRowResizeFeedbackRect(int mouseY)
3024Rectangle inside = _layout.Data;
3025Rectangle r = new(
3380private void CaptureMouse(Rectangle cursorClip)
4365Rectangle oldResizeRect = _layout.ResizeBoxRect;
4372Rectangle inside = newLayout.Inside;
4385Rectangle insideLeft = inside;
4390Rectangle colHeaders = insideLeft;
4399newLayout.ColumnHeaders = Rectangle.Empty;
4404Rectangle rowHeaders = insideLeft;
4421Rectangle topLeft;
4422Rectangle colHeaders = newLayout.ColumnHeaders;
4441newLayout.TopLeftHeader = Rectangle.Empty;
4446newLayout.RowHeaders = Rectangle.Empty;
4447newLayout.TopLeftHeader = Rectangle.Empty;
5428private RECT[]? CreateScrollableRegion(Rectangle scroll)
5488ref Rectangle rectScrollingArea,
5634Rectangle r = CalcColRelocationFeedbackRect(mouseX);
5638Rectangle rectInsertionBar = new(0, _layout.ColumnHeaders.Top, InsertionBarWidth, _layout.ColumnHeaders.Height);
5691Rectangle r = CalcColResizeFeedbackRect(mouseX);
5701Rectangle r = CalcRowResizeFeedbackRect(mouseY);
5705private void DrawShadowRect(Rectangle r)
5726private void DrawSplitBar(Rectangle r)
6074Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
6427Rectangle rectScreen = Screen.FromControl(this).WorkingArea;
6820internal Rectangle GetCellAdjustedDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow)
6822Rectangle rect = GetCellDisplayRectangle(columnIndex, rowIndex, cutOverflow);
7046public Rectangle GetCellDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow)
7048Rectangle rowRect;
7049Rectangle columnRect;
8196public Rectangle GetColumnDisplayRectangle(int columnIndex, bool cutOverflow)
8204private Rectangle GetColumnDisplayRectanglePrivate(int columnIndex, bool cutOverflow)
8210return Rectangle.Empty;
8213Rectangle data = _layout.Data;
8307Rectangle columnRect = RightToLeftInternal
8320return Rectangle.Empty;
8327Rectangle data = _layout.Data;
8567Rectangle rectScrollingArea = _layout.Data;
8584rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.RowHeaders);
8676rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.ColumnHeaders);
9026public Rectangle GetRowDisplayRectangle(int rowIndex, bool cutOverflow)
9034private Rectangle GetRowDisplayRectanglePrivate(int rowIndex, bool cutOverflow)
9040return Rectangle.Empty;
9043Rectangle data = _layout.Data;
9094Rectangle rowRect = new(data.X, cy, data.Width, displayHeight);
9108return Rectangle.Empty;
9113Rectangle data = _layout.Data;
9797Rectangle cellDisplayRect = GetCellAdjustedDisplayRectangle(columnIndex, rowIndex, true);
9822Rectangle columnDisplayRect = GetColumnDisplayRectanglePrivate(columnIndex, true);
9866Rectangle rowDisplayRect = GetRowDisplayRectanglePrivate(rowIndex, true);
9899Rectangle rowDisplayRect, data;
10434Rectangle lastSplitBarRect = CalcRowResizeFeedbackRect(_lastRowSplitBar);
10495Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
10502Rectangle lastSplitBarRect = CalcColResizeFeedbackRect(_lastColSplitBar);
13453Invalidate(Rectangle.Union(_layout.ColumnHeaders, _layout.Data));
13916Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
14493Rectangle rightArea = _layout.Data;
14496rightArea = Rectangle.Union(rightArea, _layout.ColumnHeaders);
16687Rectangle clipRect = e.ClipRectangle;
16688Rectangle gridRect = GetGridRectangle();
16692clipRect = Rectangle.Union(clipRect, CalcRowResizeFeedbackRect(_currentRowSplitBar));
16696clipRect = Rectangle.Union(clipRect, CalcColResizeFeedbackRect(_currentColSplitBar));
16744private Rectangle GetGridRectangle()
16746Rectangle gridRect = _layout.Data;
16749gridRect = Rectangle.Union(gridRect, _layout.RowHeaders);
16763gridRect = Rectangle.Union(gridRect, _layout.ColumnHeaders);
16778private Rectangle GetGridFocusRectangle()
16780Rectangle focusRect = GetGridRectangle();
16792Rectangle focusRect = GetGridFocusRectangle();
16828private void InvalidateRectangleEdges(Rectangle rect)
16831Rectangle edge = rect;
17444Rectangle right;
17445Rectangle bottom;
17446Rectangle oldClientRectangle = _layout.ClientRectangle;
17447Rectangle oldGridFocusRectangle = GetGridFocusRectangle();
17464Rectangle newClientRectangle = _normalClientRectangle;
17465Rectangle newGridFocusRectangle = DisplayRectangle;
18193Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.RowHeaders));
18826Rectangle rect = Screen.GetBounds(pt);
19210protected virtual void PaintBackground(Graphics graphics, Rectangle clipBounds, Rectangle gridBounds)
19213Rectangle rcBelowRows = gridBounds;
19239Rectangle rcNextRows = gridBounds;
19281private void PaintBorder(Graphics g, Rectangle clipRect, Rectangle bounds)
19293Rectangle edge = new(0, 0, bounds.Width, borderWidth);
19342private void PaintColumnHeaders(Graphics g, Rectangle clipBounds, bool singleBorderAdded)
19346Rectangle bandBounds, cellBounds;
19411Rectangle scrollingBounds = bandBounds;
19425Rectangle rowRect = bandBounds;
19496Rectangle gridBounds,
19497Rectangle clipRect,
19501Rectangle rc = gridBounds;
19516Rectangle columnHeadersClip = _layout.ColumnHeaders;
19560Rectangle boundingRect,
19561Rectangle clipRect,
19566Rectangle rowBounds;
19688Rectangle cellBounds = _layout.TopLeftHeader;
19816Rectangle editingZone = _layout.Data;
19832Rectangle cellBounds = new(leftEdge, GetRowYFromIndex(_ptCurrentCell.Y),
19834Rectangle cellClip = cellBounds;
25604Cursor.Clip = Rectangle.Empty;
25875Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders));
26340Rectangle rowsRect = _layout.Data;
26343rowsRect = Rectangle.Union(rowsRect, _layout.RowHeaders);
28960Rectangle rectUpper = GetCellAdjustedDisplayRectangle(-1, rowIndexStart, true);
28961Rectangle rectLower = GetCellAdjustedDisplayRectangle(-1, rowIndexEnd, true);
28971Invalidate(Rectangle.Union(rectUpper, rectLower));
29010Rectangle bottomArea = _layout.Data;
29013bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
29085Rectangle bottomArea = _layout.Data;
29088bottomArea = 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);
3068Rectangle clipBounds,
3069Rectangle cellBounds,
3083Rectangle clipBounds,
3084Rectangle cellBounds,
3120Rectangle clipBounds,
3121Rectangle bounds,
3525Rectangle clipBounds,
3526Rectangle cellValueBounds,
3544private static void PaintErrorIcon(Graphics graphics, Rectangle iconBounds)
3560Rectangle cellBounds,
3561Rectangle cellValueBounds,
3568Rectangle iconBounds = GetErrorIconBounds(graphics, cellStyle, rowIndex);
3590Rectangle bounds,
3595Rectangle rectPadding;
3630Rectangle clipBounds,
3631Rectangle cellBounds,
3746Rectangle cellBounds,
3747Rectangle cellClip,
3754Rectangle editingControlBounds = PositionEditingPanel(
3779public virtual Rectangle PositionEditingPanel(
3780Rectangle cellBounds,
3781Rectangle cellClip,
3803Rectangle 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);
994Rectangle clipBounds,
995Rectangle cellBounds,
1031private Rectangle PaintPrivate(
1033Rectangle clipBounds,
1034Rectangle cellBounds,
1055Rectangle resultBounds;
1062Rectangle valBounds = cellBounds;
1063Rectangle borderWidths = BorderWidths(advancedBorderStyle);
1146Rectangle errorBounds = valBounds;
1278Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.Width, checkBoxSize.Height);
1336Rectangle fullSize = new(checkBoxX - 1, checkBoxY - 1, checkBoxSize.Width + 3, checkBoxSize.Height + 3);
1384Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.Width - 1, checkBoxSize.Height - 1);
1543resultBounds = Rectangle.Empty;
1549resultBounds = 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 (25)
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;
711Rectangle rectThemeMargins = GetThemeMargins(graphics);
762Rectangle errorBounds = valBounds;
1020Rectangle bounds,
1029Rectangle 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,
637private Rectangle PaintPrivate(
639Rectangle clipBounds,
640Rectangle cellBounds,
662Rectangle resultBounds = Rectangle.Empty;
669Rectangle borderWidths = BorderWidths(advancedBorderStyle);
670Rectangle valBounds = cellBounds;
715Rectangle errorBounds = valBounds;
781Rectangle cellBounds,
782Rectangle cellClip,
789Rectangle 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);
530Rectangle bounds = new(Point.Empty, splitButton.Size);
547Rectangle splitButtonBounds = splitButton.ButtonBounds;
564Rectangle fillRect = splitButton.ContentRectangle;
584var clientBounds = item.ClientBounds;
594Rectangle splitButtonButtonRect = splitButton.ButtonBounds;
599Rectangle fillRect = splitButton.Selected ? splitButton.ContentRectangle : bounds;
615Rectangle dropDownRect = splitButton.DropDownButtonBounds;
661var bounds = item.ClientBounds;
671Rectangle fillRect = item.ContentRectangle;
689private static void RenderSeparatorInternal(Graphics g, ToolStripItem item, Rectangle bounds, bool vertical)
744private static void RenderSmall3DBorderInternal(Graphics g, Rectangle bounds, ToolBarState state, bool rightToLeft)
793Rectangle 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)
32Rectangle bounds = GetCachedBounds(element);
48Rectangle newBounds = bounds;
78private static Rectangle GetGrowthBounds(IArrangedElement element, Size newSize)
81Rectangle oldBounds = GetCachedBounds(element);
99Rectangle newBounds = new(location, newSize);
150private static Rectangle GetAnchorDestination(IArrangedElement element, Rectangle displayRect, bool measureOnly)
158private static Rectangle ComputeAnchoredBoundsV2(IArrangedElement element, Rectangle displayRectangle)
160Rectangle bounds = GetCachedBounds(element);
237private static Rectangle ComputeAnchoredBounds(IArrangedElement element, Rectangle displayRect, bool measureOnly)
295Rectangle cachedBounds = GetCachedBounds(element);
352Rectangle displayRectangle = container.DisplayRectangle;
380Rectangle remainingBounds = measureOnly ? Rectangle.Empty : container.DisplayRectangle;
401Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height);
414Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Bottom - elementSize.Height, elementSize.Width, elementSize.Height);
427Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height);
440Rectangle newElementBounds = new(remainingBounds.Right - elementSize.Width, remainingBounds.Y, elementSize.Width, elementSize.Height);
458Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height);
484private static void TryCalculatePreferredSizeDockedControl(IArrangedElement element, Rectangle newElementBounds, bool measureOnly, ref Size preferredSize, ref Rectangle remainingBounds)
733Rectangle cachedBounds = GetCachedBounds(element);
742Rectangle elementBounds = element.Bounds;
748Rectangle parentDisplayRect = element.Container.DisplayRectangle;
877Rectangle displayRectangle = control.Parent!.DisplayRectangle;
878Rectangle elementBounds = GetCachedBounds(control);
988Rectangle displayRect = element.Container!.DisplayRectangle;
1003private static Rectangle GetCachedBounds(IArrangedElement element)
1012return (Rectangle)bounds;
1028Rectangle displayRectangle = container.DisplayRectangle;
1059Rectangle bounds = (Rectangle)entry.Value!;
1072private static void SetCachedBounds(IArrangedElement element, Rectangle bounds)
1124Rectangle elementSpace = LayoutUtils.InflateRect(GetCachedBounds(element), margin);
1147Rectangle bounds = GetCachedBounds(element);
1152Rectangle anchorDest = GetAnchorDestination(element, Rectangle.Empty, measureOnly: true);
1163Rectangle anchorDest = GetAnchorDestination(element, Rectangle.Empty, measureOnly: true);
1167Rectangle 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;
394internal static void PrintBorder(Graphics graphics, Rectangle bounds, BorderStyle style, Border3DStyle b3dStyle)
419Rectangle bounds,
420Rectangle clipRect,
445Rectangle imageRectangle = CalculateBackgroundImageRectangle(bounds, backgroundImage.Size, backgroundImageLayout);
474Rectangle imageRect = imageRectangle;
476Rectangle partOfImageToDraw = new(Point.Empty, imageRect.Size);
488Rectangle imageRect = imageRectangle;
490Rectangle partOfImageToDraw = new(
521public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
549Rectangle bounds,
568Rectangle bounds,
976public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
986public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style)
997public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides)
1055private static void DrawBorderComplex(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style)
1142Rectangle bounds,
1179public static void DrawButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1201Rectangle rectangle,
1227public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1255public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1273public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds)
1317private static void DrawFlatCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1339Rectangle rectangle,
1348Rectangle offsetRectangle = new(
1397public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
1404public static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor)
1407internal static void DrawHighContrastFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1410internal static void DrawBlackWhiteFocusRectangle(Graphics graphics, Rectangle rectangle, Color color)
1413private static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle, Color color, bool highContrast, bool blackAndWhite = false)
1483public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled)
1495Rectangle fillRect = new(
1510public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor)
1558Rectangle destination,
1580internal static void DrawImageReplaceColor(Graphics g, Image image, Rectangle dest, Color oldColor, Color newColor)
1600internal static void DrawImageDisabled(Graphics graphics, Image image, Rectangle imageBounds, bool unscaledImage)
1666internal static void EnforceHeaderCellDividerContrast(Graphics graphics, Rectangle bounds)
1683public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary)
1701public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph)
1710Rectangle rectangle,
1746public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state)
1763public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state)
1785public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style)
1845public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state)
1870Rectangle outsideRect,
1871Rectangle insideRect,
1887public static void DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds)
1981Rectangle layoutRectangle,
1998Rectangle layoutRectangle,
2021public static void DrawVisualStyleBorder(Graphics graphics, Rectangle bounds)
2035public static void FillReversibleRectangle(Rectangle rectangle, Color backColor)
2322Rectangle bound)
2355internal 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)