332 writes to Width
System.Drawing.Primitives (3)
System\Drawing\Rectangle.cs (3)
77
Width
= value.Width;
251
Width
+= 2 * width;
280
Width
= result.Width;
System.Windows.Forms (266)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1415
b.
Width
= p.Width;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
1704
bounds.
Width
= adjusted.Width;
System\Windows\Forms\Control.cs (1)
8160
rectangle.
Width
--;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (2)
396
imageBounds.
Width
++;
469
r.
Width
+= 1;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (10)
302
layout.Focus.
Width
--;
400
layout.CheckArea.
Width
= checkSizeFull + 1;
406
layout.Field.
Width
-= checkSizeFull + 1;
412
layout.CheckArea.
Width
= checkSizeFull + 1;
417
layout.Field.
Width
-= checkSizeFull + 1;
421
layout.CheckArea.
Width
= field.Width;
432
layout.CheckArea.
Width
= field.Width;
445
layout.CheckBounds.
Width
-= CheckPaddingSize;
592
layout.TextBounds.
Width
= textRight - layout.TextBounds.X;
598
layout.ImageBounds.
Width
= Math.Max(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (6)
43
bounds.
Width
--;
55
bounds.
Width
--;
64
bounds.
Width
++;
74
bounds.
Width
++;
175
fullSize.
Width
++;
179
fullSize.
Width
++;
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (2)
46
layout.Focus.
Width
= layout.TextBounds.Width + layout.ImageBounds.Width - 1;
54
layout.Focus.
Width
+= 2;
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (2)
45
bounds.
Width
--;
85
bounds.
Width
--;
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (2)
42
_whiteFillRect.
Width
= WhiteFillRectWidth;
44
_dropDownRect.
Width
-= WhiteFillRectWidth;
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (4)
2130
rectDisplay.
Width
-= _vertScrollBar.Width;
2711
rectTmp.
Width
++;
2721
rectTmp.
Width
--;
2729
rectTmp.
Width
-= totalVisibleFrozenWidth;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (50)
2466
cursorClip.
Width
= Math.Min(frozenWidth, _layout.Data.Width);
2480
cursorClip.
Width
= Math.Min(scrollingWidth, _layout.Data.Width);
2542
clip.
Width
= leftEdge - Columns[columnIndex].MinimumThickness - _layout.Data.X + 3;
2547
clip.
Width
-= overflowWidth;
2553
clip.
Width
= _layout.Data.Right - leftEdge - 1;
2557
clip.
Width
-= overflowWidth;
2748
clip.
Width
-= MinimumRowHeadersWidth - 1;
4379
inside.
Width
= 0;
4402
rowHeaders.
Width
= Math.Min(RowHeadersWidth, rowHeaders.Width);
4412
insideLeft.
Width
-= rowHeaders.Width;
4421
topLeft.
Width
= Math.Min(RowHeadersWidth, topLeft.Width);
4422
colHeaders.
Width
-= topLeft.Width;
4457
insideLeft.
Width
--;
5493
rectScrollingArea.
Width
-= emptyBackgroundWidth;
5509
rectScrollingArea.
Width
-= frozenVisibleColumnsWidth;
6829
rect.
Width
++;
7084
rowRect.
Width
+= width;
7093
rowRect.
Width
+= width;
9095
rowRect.
Width
+= _layout.RowHeaders.Width;
10221
_layout.Data.
Width
-= vertScrollBarWidth;
10230
_layout.ColumnHeaders.
Width
-= vertScrollBarWidth;
10254
_layout.ColumnHeaders.
Width
+= vertScrollBarWidth;
10261
_layout.Data.
Width
+= vertScrollBarWidth;
10278
_layout.Data.
Width
-= vertScrollBarWidth;
10287
_layout.ColumnHeaders.
Width
-= vertScrollBarWidth;
14506
rightArea.
Width
-= rightArea.Right - leftEdge;
14510
rightArea.
Width
-= leftEdge - rightArea.X;
16755
gridRect.
Width
++;
16796
focusRect.
Width
-= change;
16803
focusRect.
Width
+= change;
16829
edge.
Width
= 1;
19246
rcNextRows.
Width
-= _layout.RowHeaders.Width;
19255
rcNextRows.
Width
--;
19265
rcNextRows.
Width
-= rowsWidth;
19302
edge.
Width
= borderWidth;
19360
cellBounds.
Width
= dataGridViewColumn.Thickness;
19363
cellBounds.
Width
++;
19414
scrollingBounds.
Width
+= FirstDisplayedScrollingColumnHiddenWidth;
19428
rowRect.
Width
-= cx;
19438
cellBounds.
Width
= dataGridViewColumn.Thickness;
19441
cellBounds.
Width
++;
19516
columnHeadersClip.
Width
++;
19686
cellBounds.
Width
= RowHeadersWidth;
19841
editingZone.
Width
= Math.Max(0, editingZone.Width - totalVisibleFrozenWidth);
19880
cellBounds.
Width
++;
19881
cellClip.
Width
++;
26352
rowsRect.
Width
++;
26379
rowsRect.
Width
= _layout.RowHeaders.Width;
29019
bottomArea.
Width
++;
29094
bottomArea.
Width
++;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (5)
419
s_rectThemeMargins.
Width
= DATAGRIDVIEWBUTTONCELL_themeMargin - rectContent.Right;
682
valBounds.
Width
-= borderWidths.Right;
707
valBounds.
Width
-= cellStyle.Padding.Horizontal;
963
valBounds.
Width
-= 2 * DATAGRIDVIEWBUTTONCELL_horizontalTextMargin;
970
valBounds.
Width
--;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (8)
848
rect.
Width
= (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.None) ? 0 : 1;
851
rect.
Width
++;
868
rect.
Width
+= OwningColumn.DividerWidth;
3174
bounds.
Width
-= dividerThickness;
3603
rectPadding.
Width
= cellStyle.Padding.Left;
3612
rectPadding.
Width
= cellStyle.Padding.Right;
3618
rectPadding.
Width
= bounds.Width - cellStyle.Padding.Horizontal;
3810
borderAndPaddingWidths.
Width
+= cellStyle.Padding.Right;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (2)
361
cellRect.
Width
= cellRight - cellLeft;
365
cellRect.
Width
= 0;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (4)
1073
valBounds.
Width
-= borderWidths.Right;
1139
valBounds.
Width
-= cellStyle.Padding.Horizontal;
1326
checkBounds.
Width
++;
1345
fullSize.
Width
++;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (7)
767
valBounds.
Width
-= borderWidths.Right;
788
valBounds.
Width
-= cellStyle.Padding.Horizontal;
855
valBounds.
Width
-= rectThemeMargins.X + rectThemeMargins.Width;
860
valBounds.
Width
-= rectThemeMargins.X + rectThemeMargins.Width;
888
valBounds.
Width
-= cellStyle.Padding.Horizontal;
906
valBounds.
Width
-= HorizontalTextMarginLeft + HorizontalTextMarginRight;
937
valBounds.
Width
-= s_sortGlyphSeparatorWidth +
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (16)
534
borderAndPaddingWidths.
Width
+= cellStyle.Padding.Right;
1767
cellBounds.
Width
+= DataGridView.FirstDisplayedScrollingColumnHiddenWidth;
1915
valBounds.
Width
-= borderWidths.Right;
1948
valBounds.
Width
-= cellStyle.Padding.Horizontal;
2176
dropRect.
Width
++;
2193
dropRect.
Width
--;
2218
textBounds.
Width
++;
2225
errorBounds.
Width
-= dropWidth;
2226
textBounds.
Width
-= dropWidth;
2235
errorBounds.
Width
-= dropWidth + 1;
2236
textBounds.
Width
-= dropWidth + 1;
2263
focusBounds.
Width
++;
2272
focusBounds.
Width
-= 2;
2288
valBounds.
Width
--;
2303
textBounds.
Width
+= 2 - HorizontalTextMarginLeft;
2308
textBounds.
Width
+= 1 - HorizontalTextMarginLeft;
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (2)
389
s_rectThemeMargins.
Width
= ThemeMargin - rectContent.Right;
540
bounds.
Width
-= borderWidths.Right;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (2)
747
valBounds.
Width
-= borderWidths.Right;
771
imageBounds.
Width
-= cellStyle.Padding.Horizontal;
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (5)
907
valBounds.
Width
-= borderWidths.Right;
934
valBounds.
Width
-= cellStyle.Padding.Horizontal;
944
valBounds.
Width
-= HorizontalTextMarginLeft + HorizontalTextMarginRight;
994
focusBounds.
Width
++;
999
focusBounds.
Width
++;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (7)
1521
cellBounds.
Width
= dataGridViewColumn.Thickness;
1524
cellBounds.
Width
++;
1589
dataBounds.
Width
+= dataGridView.FirstDisplayedScrollingColumnHiddenWidth;
1601
rowRect.
Width
-= cx;
1611
cellBounds.
Width
= dataGridViewColumn.Thickness;
1614
cellBounds.
Width
++;
1703
cellBounds.
Width
= dataGridView.RowHeadersWidth;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (7)
649
valBounds.
Width
-= borderWidths.Right;
673
valBounds.
Width
-= cellStyle.Padding.Horizontal;
725
valBounds.
Width
-= rectThemeMargins.Y + rectThemeMargins.Height;
757
valBounds.
Width
-= cellStyle.Padding.Horizontal;
839
valBounds.
Width
-= s_iconsWidth + 2 * RowHeaderIconMarginWidth;
847
valBounds.
Width
-= HorizontalTextMarginLeft + 2 * ContentMarginWidth + HorizontalTextMarginRight;
869
valBounds.
Width
-= s_iconsWidth + 2 * RowHeaderIconMarginWidth;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (1)
35
cellRect.
Width
= Owner.DataGridView.RowHeadersWidth;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (8)
154
editingControlBounds.
Width
= Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 2);
159
editingControlBounds.
Width
= Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 1);
168
editingControlBounds.
Width
= Math.Max(0, editingControlBounds.Width - 3);
178
editingControlBounds.
Width
= Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight);
183
editingControlBounds.
Width
= Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight - 1);
677
valBounds.
Width
-= borderWidths.Right;
707
valBounds.
Width
-= cellStyle.Padding.Horizontal;
730
valBounds.
Width
-= DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginLeft + DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginRight;
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (3)
236
valBounds.
Width
-= borderWidths.Right;
292
valBounds.
Width
-= cellStyle.Padding.Horizontal;
301
valBounds.
Width
-= DATAGRIDVIEWTOPLEFTHEADERCELL_horizontalTextMarginLeft + DATAGRIDVIEWTOPLEFTHEADERCELL_horizontalTextMarginRight;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
465
textRectangle.
Width
-= 2 * TextOffset;
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (8)
180
textBounds.
Width
-= 2 * BoxHeaderWidth;
188
textBounds.
Width
= measuredBounds.Width;
217
clipLeft.
Width
= BoxHeaderWidth;
218
clipMiddle.
Width
= Math.Max(0, textBounds.Width - 3); // -3 to account for the margin built in the MeasureText result
223
clipRight.
Width
= clipMiddle.X - boxBounds.X;
229
clipRight.
Width
= boxBounds.Right - clipRight.X;
283
textBounds.
Width
-= TextOffset;
291
textBounds.
Width
= measuredBounds.Width;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
2357
bounds.
Width
= MultiColumn ? Math.Max(ColumnWidth, bounds.Width) : Math.Max(MaxItemWidth, bounds.Width);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
77
bounds.
Width
= visibleArea.Width;
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (2)
103
r.
Width
-= 1;
109
r.
Width
-= 1;
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (2)
110
resultBounds.
Width
++;
115
resultBounds.
Width
-= 4;
System\Windows\Forms\Controls\ListView\ListView.cs (3)
2722
subItemBounds.
Width
= _columnHeaders[0].Width;
5011
rectInvalid.
Width
+= rectInvalid.X;
5023
rectInvalid.
Width
+= ClientRectangle.Right - rectInvalid.Right;
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
368
result.
Width
= (int)(imageSize.Width * ratio);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.SnappableControl.cs (1)
41
r.
Width
--;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (1)
49
inside.
Width
-= 3;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (3)
1556
rect.
Width
= totalWidth - rect.X;
1856
rectPaint.
Width
--;
1863
rect.
Width
-= paintIndent + 2 * PropertyGridView.ValueStringIndent;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (9)
1892
rect.
Width
= size.Width - 1;
1897
rect.
Width
= LabelWidth - 1;
1902
rect.
Width
= size.Width - LabelWidth;
2127
r.
Width
-= r.X;
4315
rect.
Width
-= 1;
4331
rect.
Width
-= sizeBtn.Width;
4339
rect.
Width
-= _paintIndent + 1;
4344
rect.
Width
-= EditIndent + 1;
4374
rect.
Width
-= 1;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
459
newBounds.
Width
= _dragBaseRect.Width - delta;
System\Windows\Forms\Controls\Splitter\Splitter.cs (4)
410
bounds.
Width
= value;
414
bounds.
Width
= value;
581
r.
Width
= minWeight;
589
r.
Width
= minWeight;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
736
rect.
Width
-= gripwidth;
4178
gripRectangle.
Width
= Grip.GripThickness;
4195
gripRectangle.
Width
= displayRect.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (1)
60
options.Client.
Width
-= widthOfDropDown;
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (1)
339
bounds.
Width
-= 1;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
101
bounds.
Width
= ParentInternal.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (1)
1026
bounds.
Width
= ParentInternal.DisplayRectangle.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
317
bounds.
Width
-= spaceToFree;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
468
cachedBounds.
Width
= (spaceToFree < 0) ? minSize.Width + -spaceToFree : minSize.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (3)
35
displayRect.
Width
= ToolStripPanel.ParentInternal.DisplayRectangle.Width - (ToolStripPanel.Margin.Horizontal + ToolStripPanel.Padding.Horizontal) - Row.Margin.Horizontal;
39
displayRect.
Width
= raftingDisplayRectangle.Width - Row.Margin.Horizontal;
70
dragBounds.
Width
+= Row.Margin.Horizontal + ToolStripPanel.Padding.Horizontal + 5;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (2)
60
dragBounds.
Width
+= dragBounds.X - x;
68
dragBounds.
Width
+= (nextRowBounds.Width >> 2) + Row.Margin.Right + ToolStripPanel.RowsInternal[index + 1].Margin.Left;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (6)
971
beginGradient.
Width
= firstGradientWidth;
972
endGradient.
Width
= secondGradientWidth + 1;
1004
endGradient.
Width
-= 1;
1227
overflowBoundsFill.
Width
= _overflowButtonWidth;
1478
bounds.
Width
= dropDownMenu.Width - bounds.X;
1485
bounds.
Width
= dropDownMenu.Width - bounds.X - dropDownMenu.Padding.Right;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
314
rect.
Width
= dropDownMenu.Width - 4;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
310
splitButtonButtonBounds.
Width
-= _splitterWidth;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (1)
162
insertionRect.
Width
= ToolStrip.s_insertionBeamWidth;
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (3)
249
bounds.
Width
-= 1;
313
bounds.
Width
= 3;
449
fillRect.
Width
-= 3; // its already 1 away from the right edge
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2762
bounds.
Width
+= value;
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (3)
550
backRect.
Width
+= 2;
565
backRect.
Width
++;
571
backRect.
Width
++;
System\Windows\Forms\Design\ComponentEditorForm.cs (1)
263
bounds.
Width
= BUTTON_WIDTH;
System\Windows\Forms\Form.cs (3)
3070
bounds.
Width
= correct.Width;
5192
_restoredWindowBounds.
Width
= width;
5216
_restoreBounds.
Width
= width;
System\Windows\Forms\Layout\CommonProperties.cs (3)
207
bounds.
Width
= Math.Min(bounds.Width, value.Width);
231
bounds.
Width
= Math.Max(bounds.Width, value.Width);
311
originalBounds.
Width
= width;
System\Windows\Forms\Layout\Containers\SplitContainer.cs (6)
1379
r.
Width
= SplitterWidthInternal;
1383
r.
Width
= minWeight;
1398
r.
Width
= Width;
1402
r.
Width
= minWeight;
1573
_splitterRect.
Width
= SplitterWidthInternal;
1580
_splitterRect.
Width
= Width;
System\Windows\Forms\Layout\DefaultLayout.cs (2)
432
remainingBounds.
Width
-= element.Bounds.Width;
444
remainingBounds.
Width
-= element.Bounds.Width;
System\Windows\Forms\Layout\FlowLayout.cs (1)
71
displayRect.
Width
= int.MaxValue - displayRect.X;
System\Windows\Forms\Layout\LayoutUtils.cs (8)
301
withinThis.
Width
= alignThis.Width;
317
withinThis.
Width
= alignThis.Width;
376
rect.
Width
+= padding.Horizontal;
385
rect.
Width
-= padding.Horizontal;
509
region1.
Width
= specifiedContent.Width;
511
region2.
Width
-= specifiedContent.Width;
515
region1.
Width
= specifiedContent.Width;
516
region2.
Width
-= specifiedContent.Width;
System\Windows\Forms\Layout\TableLayout.cs (2)
1263
cellBounds.
Width
= Math.Max(cellBounds.Width, 1);
1272
elementBounds.
Width
= Math.Min(cellBounds.Width, elementBounds.Width);
System\Windows\Forms\Printing\PrintPreviewControl.cs (3)
430
rect.
Width
= Math.Max(0, rect.Width - 1);
450
rect.
Width
-= _vScrollBar.Width;
698
box.
Width
--;
System\Windows\Forms\Rendering\ControlPaint.cs (4)
105
result.
Width
= bounds.Width;
122
result.
Width
= (int)((imageSize.Width * yRatio) + .5);
1413
rectangle.
Width
--;
1498
rectangle.
Width
--;
System\Windows\Forms\Rendering\TextExtensions.cs (1)
88
bounds.
Width
-= bounds.X;
System\Windows\Forms\Scrolling\ScrollableControl.cs (6)
201
rect.
Width
= _displayRect.Width;
223
displayRectangle.
Width
= Math.Max(displayRectangle.Width, AutoScrollMinSize.Width);
319
fullClient.
Width
+= SystemInformation.VerticalScrollBarWidth;
323
minClient.
Width
-= SystemInformation.VerticalScrollBarWidth;
502
clientToBe.
Width
-= SystemInformation.VerticalScrollBarWidth;
1045
_displayRect.
Width
= width;
System.Windows.Forms.Design (63)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (4)
572
Rectangle button = e.Bounds with {
Width
= w };
587
Rectangle res = e.Bounds with { X = e.Bounds.X + offset,
Width
= e.Bounds.Width - offset };
609
e.Bounds with {
Width
= w }, format);
617
e.Bounds with { X = e.Bounds.X + offset,
Width
= e.Bounds.Width - offset });
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (2)
210
bounds.
Width
-= PushButtonWidth;
216
bounds.
Width
-= PushButtonWidth;
System\Drawing\Design\ColorEditor.ColorPalette.cs (2)
125
rect.
Width
= s_cellSizeX;
365
Width
= s_cellSizeX,
System\Drawing\Design\IconEditor.cs (1)
123
rectangle.
Width
= icon.Width;
System\Drawing\Design\ImageEditor.cs (1)
177
r.
Width
--;
System\Windows\Forms\Design\Behavior\NoResizeSelectionBorderGlyph.cs (1)
55
hitBounds.
Width
+= DesignerUtils.s_selectionBorderHitArea - DesignerUtils.s_selectionBorderSize;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (7)
99
rect.
Width
+= _parentGridSize.Width - xDelta;
103
rect.
Width
-= xDelta;
112
rect.
Width
-= _parentGridSize.Width - xDelta;
117
rect.
Width
+= xDelta;
149
rect.
Width
= Math.Max(rect.Width, _parentGridSize.Width);
718
bounds.
Width
= Math.Max(minWidth, baseBounds.Width + (!fRTL ? (mouseLoc.X - xOffset) : (xOffset - mouseLoc.X)));
732
bounds.
Width
= Math.Max(minWidth, baseBounds.Width + xOffset);
System\Windows\Forms\Design\Behavior\SelectionBorderGlyph.cs (2)
68
hitBounds.
Width
+= DesignerUtils.s_selectionBorderHitArea - DesignerUtils.s_selectionBorderSize;
79
hitBounds.
Width
+= DesignerUtils.s_selectionBorderHitArea - DesignerUtils.s_selectionBorderSize;
System\Windows\Forms\Design\ComponentTray.cs (6)
1207
_mouseDragWorkspace.
Width
= Math.Abs(end.X - start.X);
1342
Width
= Math.Abs(e.X - _mouseDragStart.X),
1996
rc.
Width
= Math.Max(_cxIcon, sz.Width) + 4 * _borderWidth + 2 * WhiteSpace;
2001
rc.
Width
= _cxIcon + sz.Width + 4 * _borderWidth + 2 * WhiteSpace;
2277
rc.
Width
-= (2 * _borderWidth + WhiteSpace);
2306
rc.
Width
-= _cxIcon;
System\Windows\Forms\Design\ControlDesigner.cs (2)
2248
borderRectangle.
Width
-= 2;
2255
textRect.
Width
-= (textRect.X + marginX + penThickness);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
990
bounds.
Width
-= listBoxItem.ToolboxBitmap.Width + 2 * OWNERDRAWITEMIMAGEBUFFER;
System\Windows\Forms\Design\DesignerUtils.cs (2)
484
bounds.
Width
+= 2 * offset;
488
bounds.
Width
+= 2 * offset;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (3)
211
bounds.
Width
+= margin.Horizontal;
226
bounds.
Width
-= 1;
328
_childInfo[controlIndex].MarginBounds.
Width
= size.Size;
System\Windows\Forms\Design\GroupBoxDesigner.cs (1)
80
rectangle.
Width
++; // gpr: FillRectangle with a TextureBrush comes up one pixel short
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
414
rectangle.
Width
= 5;
System\Windows\Forms\Design\PanelDesigner.cs (1)
39
rc.
Width
--;
System\Windows\Forms\Design\ParentControlDesigner.cs (9)
506
bounds.
Width
= size.Width;
1095
adjustedRect.
Width
= dragRect.Width;
1172
updatedRect.
Width
= ((dragRect.X + dragRect.Width) / gridSize.Width) * gridSize.Width - updatedRect.X;
1178
updatedRect.
Width
= gridSize.Width;
1864
offset.
Width
= minControlSize.Width;
1922
_mouseDragOffset.
Width
= x - _mouseDragBase.X;
1942
_mouseDragOffset.
Width
+= offset.X;
1950
_mouseDragOffset.
Width
= -_mouseDragOffset.Width;
2041
paintRect.
Width
++; // gpr: FillRectangle with a TextureBrush comes up one pixel short
System\Windows\Forms\Design\PictureBoxDesigner.cs (1)
53
rc.
Width
--;
System\Windows\Forms\Design\SelectionUIHandler.cs (3)
77
b.
Width
= bounds[i].Width;
343
newBounds.
Width
= tempNewBounds.Width;
348
newBounds.
Width
= tempNewBounds.Width;
System\Windows\Forms\Design\SelectionUIService.cs (5)
668
_mouseDragOffset.
Width
= _mouseDragAnchor.X - screenCoord.X;
672
_mouseDragOffset.
Width
= screenCoord.X - _mouseDragAnchor.X;
694
delta.
Width
-= old.Width;
1082
newOffset = offset with {
Width
= 0, Height = 0 };
1086
newOffset.
Width
= newOffset.Height = 0;
System\Windows\Forms\Design\SplitterDesigner.cs (1)
27
rectangle.
Width
--;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
849
rc.
Width
--;
System\Windows\Forms\Design\TabOrder.cs (1)
257
convertedRectangle.
Width
= sz.Width + 2;
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
791
fillBounds.
Width
-= 1;
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
65
r.
Width
++;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
162
bounds.
Width
--;
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
242
rc.
Width
--;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1814
bounds.
Width
--;
1272 references to Width
PresentationUI (1)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (1)
1042
cellBounds.X + (cellBounds.
Width
- boxSize.Width) / 2,
System.ComponentModel.TypeConverter (2)
System\Drawing\RectangleConverter.cs (2)
77
intConverter.ConvertToString(context, culture, rect.
Width
),
90
rect.X, rect.Y, rect.
Width
, rect.Height});
System.Drawing.Common.Tests (108)
mono\System.Imaging\MetafileTest.cs (2)
70
Assert.Equal(3096, header.Bounds.
Width
);
193
Assert.Equal(0, mh.Bounds.
Width
);
System\Drawing\BitmapTests.cs (4)
374
Assert.Equal(rectangle.
Width
, clone.Width);
379
for (int x = 0; x < rectangle.
Width
; x++)
410
Assert.Equal(rectangle.
Width
, clone.Width);
1068
Assert.Equal(rectangle.
Width
, data.Width);
System\Drawing\Imaging\ImageAttributesTests.cs (94)
70
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
77
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, clone);
94
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
99
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
103
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
147
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
152
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
157
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
171
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
179
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
183
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
187
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
202
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
210
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
273
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
281
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
298
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
308
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
312
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
316
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
342
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
348
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
365
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
371
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
392
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
398
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
421
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
427
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
482
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
487
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
495
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
500
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
508
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
513
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
537
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
543
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
551
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
557
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
581
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
586
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
594
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
599
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
607
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
612
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
638
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
645
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
669
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
676
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
684
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
692
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
717
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
726
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
734
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
743
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
751
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
760
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
785
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
792
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
800
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
807
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
815
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
821
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
848
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
855
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
863
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
870
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
904
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
910
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
930
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
936
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
960
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
966
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1009
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1016
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1024
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1031
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1056
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1062
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1122
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1130
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1138
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1146
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1171
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1176
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1184
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1189
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1197
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1202
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1248
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1254
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1262
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1268
graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.
Width
, _rectangle.Height, GraphicsUnit.Pixel, imageAttr);
1307
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
1322
using Bitmap bitmap = new(_rectangle.
Width
, _rectangle.Height);
System\Drawing\RegionTests.cs (8)
1342
Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height));
1343
Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height));
1344
Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, s_graphic));
1345
Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, disposedGraphics));
1346
Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, null));
1347
Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, s_graphic));
1348
Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, disposedGraphics));
1349
Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, null));
System.Drawing.Primitives (18)
System\Drawing\Rectangle.cs (17)
74
readonly get => new Size(
Width
, Height);
139
public readonly int Right => unchecked(X +
Width
);
149
/// Tests whether this <see cref='System.Drawing.Rectangle'/> has a <see cref='System.Drawing.Rectangle.
Width
'/>
167
left.X == right.X && left.Y == right.Y && left.
Width
== right.
Width
&& left.Height == right.Height;
223
public readonly bool Contains(int x, int y) => X <= x && x < X +
Width
&& Y <= y && y < Y + Height;
236
(X <= rect.X) && (rect.X + rect.
Width
<= X +
Width
) &&
239
public override readonly int GetHashCode() => HashCode.Combine(X, Y,
Width
, Height);
280
Width = result.
Width
;
291
int x2 = Math.Min(a.X + a.
Width
, b.X + b.
Width
);
307
(rect.X < X +
Width
) && (X < rect.X + rect.
Width
) &&
316
int x2 = Math.Max(a.X + a.
Width
, b.X + b.
Width
);
343
public override readonly string ToString() => $"{{X={X},Y={Y},Width={
Width
},Height={Height}}}";
System\Drawing\RectangleF.cs (1)
323
public static implicit operator RectangleF(Rectangle r) => new RectangleF(r.X, r.Y, r.
Width
, r.Height);
System.Private.Windows.Core (1)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
169
value.
Width
,
System.Windows.Forms (823)
System\Windows\Forms\Accessibility\AccessibleObject.cs (3)
1062
width = BoundingRectangle.
Width
1700
*pcxWidth = bounds.
Width
;
1713
*pcxWidth = bounds.
Width
;
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (1)
201
=> rect.IsEmpty || rect.
Width
<= 0 || rect.Height <= 0;
System\Windows\Forms\ActiveX\AxHost.cs (2)
1201
if (oldBounds.X == x && oldBounds.Y == y && oldBounds.
Width
== width && oldBounds.Height == height)
1215
if (width != oldBounds.
Width
|| height != oldBounds.Height)
System\Windows\Forms\Control.cs (11)
1009
set => SetBounds(value.X, value.Y, value.
Width
, value.Height, BoundsSpecified.All);
4903
if (targetBounds.
Width
<= 0 || targetBounds.Height <= 0
4914
int width = Math.Min(Width, targetBounds.
Width
);
5302
int sw = bounds.
Width
;
5327
int localWidth = bounds.
Width
- adornmentsBeforeDpiChange.Width;
8163
e.Graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.
Width
- 1, rectangle.Height - 1);
8231
rectangle.
Width
,
10070
width = adjustedBounds.
Width
;
11746
if (doubleBuffered && (clip.
Width
<= 0 || clip.Height <= 0))
12634
if (sizeProperty is not null && !sizeProperty.IsReadOnly && (bounds.
Width
!= Width || bounds.Height != Height))
12662
SetBoundsCore(bounds.X, bounds.Y, bounds.
Width
, bounds.Height, specified);
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1183
ShowToolTip = (ClientRectangle.
Width
< preferredSize.Width || ClientRectangle.Height < preferredSize.Height);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (11)
137
Point p1 = new(bounds.X + bounds.
Width
- 1, bounds.Y); // Upper inner right
140
Point p4 = new(bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height - 1); // Inner bottom right
192
Point p1 = new(bounds.X + bounds.
Width
- 1, bounds.Y); // Upper inner right
195
Point p4 = new(bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height - 1); // Inner bottom right
240
Point p1 = new(bounds.X + bounds.
Width
- 1, bounds.Y); // Upper inner right
243
Point p4 = new(bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height - 1); // Inner bottom right
330
size = Math.Min(size, Math.Min(bounds.
Width
, bounds.Height));
333
Rectangle right = new(bounds.X + bounds.
Width
- size, bounds.Y, size, bounds.Height);
334
Rectangle top = new(bounds.X + size, bounds.Y, bounds.
Width
- size * 2, size);
335
Rectangle bottom = new(bounds.X + size, bounds.Y + bounds.Height - size, bounds.
Width
- size * 2, size);
438
graphics.DrawRectangle(pen, r.X, r.Y, r.
Width
- 1, r.Height - 1);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (15)
283
layout.TextBounds.
Width
+ 2,
299
if (layout.Focus.
Width
% 2 == 0)
374
layout.CheckBounds.X = (field.X + field.
Width
) - layout.CheckBounds.
Width
;
378
layout.CheckBounds.X = field.X + (field.
Width
- layout.CheckBounds.
Width
) / 2;
411
layout.CheckArea.X = field.X + field.
Width
- checkSizeFull;
421
layout.CheckArea.Width = field.
Width
;
432
layout.CheckArea.Width = field.
Width
;
590
Math.Min(layout.TextBounds.X, layout.Field.X + (layout.Field.
Width
- layout.TextBounds.
Width
) / 2),
600
Math.Min(maxBounds.
Width
- layout.TextBounds.
Width
, layout.ImageBounds.
Width
));
601
layout.TextBounds.X = layout.ImageBounds.X + layout.ImageBounds.
Width
;
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (4)
173
if (fullSize.
Width
== checkSize)
298
&& cacheCheckImage.Width == fullSize.
Width
307
RECT rcCheck = new Rectangle(0, 0, fullSize.
Width
, fullSize.Height);
308
Bitmap bitmap = new(fullSize.
Width
, fullSize.Height);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (2)
46
layout.Focus.Width = layout.TextBounds.
Width
+ layout.ImageBounds.
Width
- 1;
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
262
=> rect.IsEmpty || rect.
Width
<= 0 || rect.Height <= 0;
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (12)
33
_outerBorder = new Rectangle(_clientRect.Location, new Size(_clientRect.
Width
- 1, _clientRect.Height - 1));
34
_innerBorder = new Rectangle(_outerBorder.X + 1, _outerBorder.Y + 1, _outerBorder.
Width
- dropDownButtonWidth - 2, _outerBorder.Height - 2);
35
_innerInnerBorder = new Rectangle(_innerBorder.X + 1, _innerBorder.Y + 1, _innerBorder.
Width
- 2, _innerBorder.Height - 2);
51
_innerBorder.X = _clientRect.
Width
- _innerBorder.Right;
52
_innerInnerBorder.X = _clientRect.
Width
- _innerInnerBorder.Right;
53
_dropDownRect.X = _clientRect.
Width
- _dropDownRect.Right;
54
_whiteFillRect.X = _clientRect.
Width
- _whiteFillRect.Right + 1; // since we're filling, we need to move over to the next px.
97
new Rectangle(_outerBorder.X, _outerBorder.Y, _dropDownRect.
Width
+ 1, _outerBorder.Height));
125
new Rectangle(_outerBorder.X, _outerBorder.Y, _dropDownRect.
Width
+ 1, _outerBorder.Height));
148
Point middle = new(dropDownRect.Left + dropDownRect.
Width
/ 2, dropDownRect.Top + dropDownRect.Height / 2);
152
middle.X -= (dropDownRect.
Width
% 2);
157
middle.X += (dropDownRect.
Width
% 2);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (4)
470
_vertScrollBar.Left = ClientRectangle.
Width
- _vertScrollBar.Width;
2462
int displayWidth = _layout.Data.
Width
;
2675
int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.
Width
;
2797
if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.
Width
) <= 0)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (103)
540
if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) > _layout.Data.
Width
)
548
int availableWidth = _layout.Data.
Width
; // Width available for auto-filled columns
594
int maximumPossibleWidth = _layout.Data.
Width
- imposedWidthSum;
748
int maximumPossibleWidth = _layout.Data.
Width
- imposedWidthSum;
925
Debug.Assert(_layout.Data.
Width
== _layout.Inside.
Width
- _layout.RowHeaders.
Width
- (SingleVerticalBorderAdded ? 1 : 0));
926
int availableWidth = _layout.Data.
Width
- imposedWidthSum;
940
&& SystemInformation.VerticalScrollBarWidth <= _layout.Data.
Width
)
1757
if (_layout.TopLeftHeader.
Width
> 0)
1760
? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.
Width
)
1822
if (_layout.TopLeftHeader.
Width
> 0)
1825
? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.
Width
)
2015
if (_layout.TopLeftHeader.
Width
> 0)
2177
if (_layout.TopLeftHeader.
Width
> 0)
2432
if (_layout.TopLeftHeader.
Width
> 0)
2463
cursorClip.X += cursorClip.
Width
- frozenWidth;
2466
cursorClip.Width = Math.Min(frozenWidth, _layout.Data.
Width
);
2475
else if (_layout.Data.
Width
> frozenWidth + scrollingWidth)
2477
cursorClip.X += _layout.Data.
Width
- frozenWidth - scrollingWidth;
2480
cursorClip.Width = Math.Min(scrollingWidth, _layout.Data.
Width
);
2740
if (_layout.TopLeftHeader.
Width
> 0)
2971
if (_layout.TopLeftHeader.
Width
> 0)
2984
r.X = Math.Min(r.X, inside.Right - r.
Width
);
2993
r.X = Math.Min(inside.Right - r.
Width
, r.X);
3027
inside.
Width
,
4214
if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >= _layout.Data.
Width
)
4365
newLayout.Inside = _normalClientRectangle.
Width
> 0 || _normalClientRectangle.Height > 0
4377
if (inside.
Width
< 0)
4402
rowHeaders.Width = Math.Min(RowHeadersWidth, rowHeaders.
Width
);
4405
rowHeaders.X += insideLeft.
Width
- rowHeaders.
Width
;
4409
insideLeft.X += rowHeaders.
Width
;
4412
insideLeft.Width -= rowHeaders.
Width
;
4413
Debug.Assert(insideLeft.
Width
>= 0);
4421
topLeft.Width = Math.Min(RowHeadersWidth, topLeft.
Width
);
4422
colHeaders.Width -= topLeft.
Width
;
4425
topLeft.X += insideLeft.
Width
;
4429
colHeaders.X += topLeft.
Width
;
4432
Debug.Assert(colHeaders.
Width
>= 0);
4455
if (insideLeft.
Width
> 0)
4476
Debug.Assert(newLayout.Data.
Width
>= 0);
4568
int displayWidth = _layout.Data.
Width
, cx = 0;
5522
int cxMax = _layout.Data.
Width
, cx = 0;
5710
PInvoke.PatBlt(dc, r.X, r.Y, r.
Width
, DATAGRIDVIEW_shadowEdgeThickness, ROP_CODE.PATINVERT);
5711
PInvoke.PatBlt(dc, r.X, r.Y + r.Height - DATAGRIDVIEW_shadowEdgeThickness, r.
Width
, DATAGRIDVIEW_shadowEdgeThickness, ROP_CODE.PATINVERT);
5713
PInvoke.PatBlt(dc, r.X + r.
Width
- DATAGRIDVIEW_shadowEdgeThickness, r.Y + DATAGRIDVIEW_shadowEdgeThickness, DATAGRIDVIEW_shadowEdgeThickness, r.Height - 2 * DATAGRIDVIEW_shadowEdgeThickness, ROP_CODE.PATINVERT);
5728
PInvoke.PatBlt(dc, r.X, r.Y, r.
Width
, r.Height, ROP_CODE.PATINVERT);
8569
int emptyBackgroundWidth = Math.Max(0, _layout.Data.
Width
- Columns.GetColumnsWidth(DataGridViewElementStates.Visible));
9091
Rectangle rowRect = new(data.X, cy, data.
Width
, displayHeight);
9095
rowRect.Width += _layout.RowHeaders.
Width
;
9098
rowRect.X -= _layout.RowHeaders.
Width
;
10018
Invalidate(new Rectangle(data.X, top, data.
Width
, bottom - top));
10172
&& totalVisibleWidth > _layout.Data.
Width
10173
&& totalVisibleFrozenWidth < _layout.Data.
Width
10180
if (totalVisibleWidth - _layout.Data.
Width
<= vertScrollBarWidth
10181
|| _layout.Data.
Width
- totalVisibleFrozenWidth <= vertScrollBarWidth)
10190
needHorizScrollbar = totalVisibleFrozenWidth < _layout.Data.
Width
- vertScrollBarWidth;
10219
&& vertScrollBarWidth <= _layout.Data.
Width
)
10222
Debug.Assert(_layout.Data.
Width
>= 0);
10231
Debug.Assert(_layout.ColumnHeaders.
Width
>= 0);
10248
&& totalVisibleWidth > _layout.Data.
Width
&& totalVisibleFrozenWidth < _layout.Data.
Width
10276
&& vertScrollBarWidth <= _layout.Data.
Width
)
10279
Debug.Assert(_layout.Data.
Width
>= 0);
10288
Debug.Assert(_layout.ColumnHeaders.
Width
>= 0);
10313
int widthNotVisible = totalVisibleWidth - _layout.Data.
Width
;
10322
rightToLeftInternal ? _layout.Inside.X + _layout.ResizeBoxRect.
Width
: _layout.Inside.X,
10324
_layout.Inside.
Width
- _layout.ResizeBoxRect.
Width
,
14501
if (rightArea.
Width
> 0 && rightArea.Height > 0)
14514
if (rightArea.
Width
> 0 && rightArea.Height > 0)
16833
edge.X += rect.
Width
- 1;
17446
right = new Rectangle(oldClientRectangle.X + oldClientRectangle.
Width
- borderWidth,
17452
oldClientRectangle.
Width
,
17465
if (newClientRectangle.
Width
!= oldClientRectangle.
Width
)
17468
right = new Rectangle(newClientRectangle.X + newClientRectangle.
Width
- borderWidth,
17480
newClientRectangle.
Width
,
17488
right = new Rectangle(oldGridFocusRectangle.X + oldGridFocusRectangle.
Width
- 1,
17496
oldGridFocusRectangle.
Width
,
19227
if (rcBelowRows.
Width
> 0 && rcBelowRows.Height > 0)
19243
rcNextRows.X += _layout.RowHeaders.
Width
;
19246
rcNextRows.Width -= _layout.RowHeaders.
Width
;
19271
if (rcNextRows.
Width
> 0 && rcNextRows.Height > 0)
19290
Rectangle edge = new(0, 0, bounds.
Width
, borderWidth);
19307
edge.X = bounds.
Width
- borderWidth;
19320
g.DrawRectangle(pen, new Rectangle(0, 0, bounds.
Width
- 1, bounds.Height - 1));
19330
g.DrawRectangle(pen, new Rectangle(0, 0, bounds.
Width
- 1, bounds.Height - 1));
19366
Debug.Assert(cellBounds.
Width
> 0);
19367
cellBounds.X = RightToLeftInternal ? bandBounds.Right - cx - cellBounds.
Width
: bandBounds.X + cx;
19397
cx += cellBounds.
Width
;
19398
if (cx >= bandBounds.
Width
)
19416
if (DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0 && cx < scrollingBounds.
Width
)
19444
Debug.Assert(cellBounds.
Width
> 0);
19446
? scrollingBounds.Right - cx - cellBounds.
Width
19471
cx += cellBounds.
Width
;
19472
if (cx >= scrollingBounds.
Width
)
19500
if (_layout.TopLeftHeader.
Width
> 0 && (clipRect.IntersectsWith(_layout.TopLeftHeader) || _lastHeaderShadow != -1))
19814
if (editingZone.
Width
== 0 || editingZone.Height == 0)
19841
editingZone.Width = Math.Max(0, editingZone.
Width
- totalVisibleFrozenWidth);
19857
if (cellClip.
Width
== 0 || cellClip.Height == 0)
26379
rowsRect.Width = _layout.RowHeaders.
Width
;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (7)
294
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
310
marginWidths = rectThemeMargins.X + rectThemeMargins.
Width
;
685
if (valBounds.Height <= 0 || valBounds.
Width
<= 0)
713
if (valBounds.Height > 0 && valBounds.
Width
> 0 && (paint || computeContentBounds))
875
Debug.Assert(valBounds.Height <= 0 || valBounds.
Width
<= 0);
884
valBounds.
Width
> 2 * SystemInformation.Border3DSize.Width + 1 &&
974
if (valBounds.
Width
> 0 && valBounds.Height > 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (17)
1016
if (cellValueBounds.
Width
>= IconMarginWidth * 2 + s_iconsWidth &&
2759
if (contentBounds.
Width
> 0)
2766
contentBounds.
Width
,
3149
if (dividerThickness > bounds.
Width
)
3151
dividerThickness = bounds.
Width
;
3175
if (bounds.
Width
<= 0)
3199
bounds.X, bounds.Bottom - dividerThickness, bounds.
Width
, dividerThickness);
3539
cellValueBounds.
Width
>= IconMarginWidth * 2 + s_iconsWidth &&
3567
cellValueBounds.
Width
>= IconMarginWidth * 2 + s_iconsWidth &&
3571
if (iconBounds.
Width
>= IconMarginWidth && iconBounds.Height >= s_iconsHeight)
3618
rectPadding.Width = bounds.
Width
- cellStyle.Padding.Horizontal;
3776
editingControl.Size = new Size(editingControlBounds.
Width
, editingControlBounds.Height);
3812
int xEditingPanel, wEditingPanel = cellBounds.
Width
;
3828
if (cellClip.Right <= cellBounds.Right - borderAndPaddingWidths.
Width
)
3834
wEditingPanel -= borderAndPaddingWidths.
Width
;
3838
wEditingControl = cellBounds.
Width
- borderAndPaddingWidths.X - borderAndPaddingWidths.
Width
;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (1)
330
int cellRight = columnRect.Left + columnRect.
Width
;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (7)
650
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
1207
if (valBounds.
Width
>= checkBoxSize.Width && valBounds.Height >= checkBoxSize.Height && (paint || computeContentBounds))
1219
checkBoxX = valBounds.Left + (valBounds.
Width
- checkBoxSize.Width) / 2;
1348
if (s_checkImage is null || s_checkImage.Width != fullSize.
Width
|| s_checkImage.Height != fullSize.Height)
1358
RECT rcCheck = new Rectangle(0, 0, fullSize.
Width
, fullSize.Height);
1359
Bitmap bitmap = new(fullSize.
Width
, fullSize.Height);
1556
Debug.Assert(valBounds.
Width
< checkBoxSize.Width || valBounds.Height < checkBoxSize.Height, "the bounds are empty");
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (17)
498
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
693
preferredSize.Width += rectThemeMargins.X + rectThemeMargins.
Width
;
794
if (paint && PaintBackground(paintParts) && backgroundBounds.
Width
> 0 && backgroundBounds.Height > 0)
831
bmFlipXPThemes.Width < backgroundBounds.
Width
|| bmFlipXPThemes.Width > 2 * backgroundBounds.
Width
||
834
bmFlipXPThemes = FlipXPThemesBitmap = new Bitmap(backgroundBounds.
Width
, backgroundBounds.Height);
838
DataGridViewColumnHeaderCellRenderer.DrawHeader(gFlip, new Rectangle(0, 0, backgroundBounds.
Width
, backgroundBounds.Height), state);
840
g.DrawImage(bmFlipXPThemes, backgroundBounds, new Rectangle(bmFlipXPThemes.Width - backgroundBounds.
Width
, 0, backgroundBounds.
Width
, backgroundBounds.Height), GraphicsUnit.Pixel);
854
valBounds.X += rectThemeMargins.
Width
;
855
valBounds.Width -= rectThemeMargins.X + rectThemeMargins.
Width
;
860
valBounds.Width -= rectThemeMargins.X + rectThemeMargins.
Width
;
865
if (paint && PaintBackground(paintParts) && backgroundBounds.
Width
> 0 && backgroundBounds.Height > 0)
901
if (valBounds.
Width
- HorizontalTextMarginLeft - HorizontalTextMarginRight > 0 &&
921
int width = valBounds.
Width
-
993
valBounds.
Width
>= s_sortGlyphWidth + 2 * s_sortGlyphHorizontalMargin &&
997
sortGlyphLocation = new Point(valBounds.Left + (valBounds.
Width
- s_sortGlyphWidth) / 2,
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (31)
537
Size adjustedSize = new(size.Width - borderAndPaddingWidths.X - borderAndPaddingWidths.
Width
,
562
if (x >= size.Width - borderAndPaddingWidths.
Width
- dropWidth - 1 &&
563
x <= size.Width - borderAndPaddingWidths.
Width
- 1)
1177
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
1932
if (paint && PaintBackground(paintParts) && !brushColor.HasTransparency() && valBounds.
Width
> 0 && valBounds.Height > 0)
1952
if (paint && valBounds.
Width
> 0 && valBounds.Height > 0)
1958
g.FillRectangle(brush!, valBounds.Left, valBounds.Top, valBounds.
Width
, valBounds.Height);
1974
PaintBackground(paintParts) && !brushColor.HasTransparency() && valBounds.
Width
> 2 && valBounds.Height > 2)
1976
g.FillRectangle(brush!, valBounds.Left + 1, valBounds.Top + 1, valBounds.
Width
- 2, valBounds.Height - 2);
1983
g.DrawRectangle(SystemPens.ControlLightLight, new Rectangle(valBounds.X, valBounds.Y, valBounds.
Width
- 1, valBounds.Height - 1));
1987
g.FillRectangle(brush!, valBounds.Left, valBounds.Top, valBounds.
Width
, valBounds.Height);
1992
int dropWidth = Math.Min(SystemInformation.HorizontalScrollBarThumbWidth, valBounds.
Width
- 2 * Margin - 1);
2096
dropRect.X + dropRect.
Width
- 1, dropRect.Y);
2105
valBounds.X + valBounds.
Width
- 1, valBounds.Y + valBounds.Height - 1);
2106
g.DrawLine(pen, valBounds.X + valBounds.
Width
- 1, valBounds.Y,
2107
valBounds.X + valBounds.
Width
- 1, valBounds.Y + valBounds.Height - 1);
2116
dropRect.X + dropRect.
Width
- 1, dropRect.Y + dropRect.Height - 1);
2117
g.DrawLine(pen, dropRect.X + dropRect.
Width
- 1, dropRect.Y,
2118
dropRect.X + dropRect.
Width
- 1, dropRect.Y + dropRect.Height - 1);
2125
valBounds.X + valBounds.
Width
- 2, valBounds.Y);
2135
dropRect.X + dropRect.
Width
- 2, dropRect.Y + 1);
2145
dropRect.X + dropRect.
Width
- 2, dropRect.Y + dropRect.Height - 2);
2146
g.DrawLine(pen, dropRect.X + dropRect.
Width
- 2, dropRect.Y + 1,
2147
dropRect.X + dropRect.
Width
- 2, dropRect.Y + dropRect.Height - 2);
2155
Point middle = new(dropRect.Left + dropRect.
Width
/ 2, dropRect.Top + dropRect.Height / 2);
2157
middle.X += (dropRect.
Width
% 2);
2178
Point middle = new(dropRect.Left + (dropRect.
Width
- 1) / 2,
2181
middle.X += ((dropRect.
Width
+ 1) % 2);
2245
if (textBounds.
Width
> 1 && textBounds.Height > 1)
2275
if (focusBounds.
Width
> 0 && focusBounds.Height > 0)
2313
if (textBounds.
Width
> 0 && textBounds.Height > 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
394
s_rectThemeMargins.Y + s_rectThemeMargins.
Width
+ s_rectThemeMargins.Height == 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (15)
410
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
588
if (imgWidth * bounds.Height < imgHeight * bounds.
Width
)
603
bounds.
Width
,
604
decimal.ToInt32((decimal)imgHeight * bounds.
Width
/ imgWidth));
616
DataGridViewContentAlignment.TopLeft => bounds.Right - imageBounds.
Width
,
618
DataGridViewContentAlignment.MiddleLeft => bounds.Right - imageBounds.
Width
,
620
DataGridViewContentAlignment.BottomLeft => bounds.Right - imageBounds.
Width
,
628
DataGridViewContentAlignment.TopRight => bounds.Right - imageBounds.
Width
,
630
DataGridViewContentAlignment.MiddleRight => bounds.Right - imageBounds.
Width
,
632
DataGridViewContentAlignment.BottomRight => bounds.Right - imageBounds.
Width
,
643
imageBounds.X = bounds.X + (bounds.
Width
- imageBounds.
Width
) / 2;
750
if (valBounds.
Width
<= 0 || valBounds.Height <= 0 || (!paint && !computeContentBounds))
760
Debug.Assert(valBounds.Height <= 0 || valBounds.
Width
<= 0);
785
if (imageBounds.
Width
<= 0 || imageBounds.Height <= 0 || (icon is null && image is null))
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (4)
551
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
977
if (valBounds.
Width
> 0 && valBounds.Height > 0)
1040
errorBounds.
Width
> 0 &&
1055
valBounds.
Width
> 0 &&
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (11)
1527
Debug.Assert(cellBounds.
Width
> 0);
1530
cellBounds.X = rowBounds.Right - cx - cellBounds.
Width
;
1567
cx += cellBounds.
Width
;
1568
if (cx >= rowBounds.
Width
)
1580
if (cx < dataBounds.
Width
)
1617
Debug.Assert(cellBounds.
Width
> 0);
1620
cellBounds.X = dataBounds.Right - cx - cellBounds.
Width
;
1657
cx += cellBounds.
Width
;
1658
if (cx >= dataBounds.
Width
)
1704
Debug.Assert(cellBounds.
Width
> 0);
1707
cellBounds.X = rowBounds.Right - cellBounds.
Width
;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (17)
530
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
542
borderAndPaddingHeights += rectThemeMargins.
Width
;
677
if (backgroundBounds.
Width
> 0 && backgroundBounds.Height > 0)
702
using Bitmap bmFlipXPThemes = new(backgroundBounds.Height, backgroundBounds.
Width
);
704
DataGridViewRowHeaderCellRenderer.DrawHeader(gFlip, new Rectangle(0, 0, backgroundBounds.Height, backgroundBounds.
Width
), state);
710
new Rectangle(0, 0, backgroundBounds.
Width
, backgroundBounds.Height),
726
valBounds.Height -= rectThemeMargins.X + rectThemeMargins.
Width
;
733
if (valBounds.
Width
> 0 && valBounds.Height > 0)
764
if (valBounds.
Width
> 0 && valBounds.Height > 0)
771
if (valBounds.
Width
>= s_iconsWidth + 2 * RowHeaderIconMarginWidth
840
Debug.Assert(valBounds.
Width
>= 0);
849
if (valBounds.
Width
> 0 && valBounds.Height > 0)
852
if (DataGridView.ShowRowErrors && valBounds.
Width
> s_iconsWidth + 2 * RowHeaderIconMarginWidth)
855
Size maxBounds = new(valBounds.
Width
- s_iconsWidth - 2 * RowHeaderIconMarginWidth, valBounds.Height);
908
if (errorBounds.
Width
>= 3 * RowHeaderIconMarginWidth + 2 * s_iconsWidth)
927
if (valBounds.
Width
>= s_iconsWidth + 2 * RowHeaderIconMarginWidth &&
991
if (errorBounds.
Width
>= 3 * RowHeaderIconMarginWidth +
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (1)
38
cellRect.X = rowRect.Right - cellRect.
Width
;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (10)
142
int originalWidth = editingControlBounds.
Width
;
154
editingControlBounds.Width = Math.Max(0, editingControlBounds.
Width
- DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 2);
159
editingControlBounds.Width = Math.Max(0, editingControlBounds.
Width
- DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 1);
168
editingControlBounds.Width = Math.Max(0, editingControlBounds.
Width
- 3);
178
editingControlBounds.Width = Math.Max(0, editingControlBounds.
Width
- DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight);
183
editingControlBounds.Width = Math.Max(0, editingControlBounds.
Width
- DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight - 1);
403
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
684
bool notCollapsed = valBounds.
Width
> 0 && valBounds.Height > 0;
732
if (valBounds.
Width
> 0 && valBounds.Height > 0)
804
DataGridView.EditingControl.Size = new Size(editingControlBounds.
Width
, editingControlBounds.Height);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (2)
146
int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.
Width
+ cellStyle.Padding.Horizontal;
303
if (valBounds.
Width
> 0 &&
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (5)
323
if (sizeRequired.Width > cellBounds.
Width
)
329
Size sizeCell = new(cellBounds.
Width
, cellBounds.Height);
397
ptTextLocation.X = cellBounds.X + (cellBounds.
Width
- sizeText.Width) / 2;
412
ptTextLocation.X = cellBounds.X + (cellBounds.
Width
- sizeText.Width) / 2;
427
ptTextLocation.X = cellBounds.X + (cellBounds.
Width
- sizeText.Width) / 2;
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
1023
int width = CommonProperties.GetSpecifiedBounds(this).
Width
;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (3)
486
textSize = Size.Ceiling(graphics.MeasureString(Text, Font, textRectangle.
Width
, format));
515
textSize = hdc.HDC.MeasureText(Text, hfont, new Size(textRectangle.
Width
, int.MaxValue), (TextFormatFlags)flags);
537
textLeft += textRectangle.
Width
- textSize.Width;
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (25)
185
new Size(textBounds.
Width
, textBounds.Height),
194
textBounds.X = bounds.Right - textBounds.
Width
- BoxHeaderWidth + 1;
218
clipMiddle.Width = Math.Max(0, textBounds.
Width
- 3); // -3 to account for the margin built in the MeasureText result
222
clipMiddle.X = clipLeft.Left - clipMiddle.
Width
;
257
g.DrawLine(light, bounds.Left, bounds.Height - 1, bounds.
Width
- 1, bounds.Height - 1);
258
g.DrawLine(dark, bounds.Left, bounds.Height - 2, bounds.
Width
- 1, bounds.Height - 2);
261
g.DrawLine(light, bounds.Left + 1, bounds.Top + 1, bounds.
Width
- 1, bounds.Top + 1);
262
g.DrawLine(dark, bounds.Left, bounds.Top, bounds.
Width
- 2, bounds.Top);
265
g.DrawLine(light, bounds.
Width
- 1, bounds.Top, bounds.
Width
- 1, bounds.Height - 1);
266
g.DrawLine(dark, bounds.
Width
- 2, bounds.Top, bounds.
Width
- 2, bounds.Height - 2);
288
new Size(textBounds.
Width
, textBounds.Height),
296
textBounds.X = bounds.Right - textBounds.
Width
- TextOffset;
306
if (textBounds.
Width
> 0)
322
bounds.Left, bounds.Height - 2, bounds.
Width
- 1, bounds.Height - 2, // Right
324
textBounds.X + textBounds.
Width
+ 2, boxTop - 1, bounds.
Width
- 2, boxTop - 1, // Top-right
325
bounds.
Width
- 2, boxTop - 1, bounds.
Width
- 2, bounds.Height - 2 // Right
334
bounds.Left, bounds.Height - 1, bounds.
Width
, bounds.Height - 1, // Right
336
textBounds.X + textBounds.
Width
+ 1, boxTop, bounds.
Width
- 1, boxTop, // Top-right
337
bounds.
Width
- 1, boxTop, bounds.
Width
- 1, bounds.Height - 1 // Right
System\Windows\Forms\Controls\Labels\Label.cs (4)
882
xLoc = (r.X + r.
Width
- 4) - pointImageSize.Width;
886
xLoc = r.X + (r.
Width
- pointImageSize.Width) / 2;
1272
Size preferredSize = GetPreferredSize(new Size(clientRect.
Width
, clientRect.Height));
1273
_showToolTip = (clientRect.
Width
< preferredSize.Width || clientRect.Height < preferredSize.Height);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (10)
378
xLoc = clientRect.Right - textRect.
Width
;
382
xLoc = (clientRect.
Width
- textRect.
Width
) / 2;
403
if (textRect.
Width
> clientRect.
Width
)
406
width = clientRect.
Width
;
410
width = textRect.
Width
;
557
Size clientSize = new(clientRectWithPadding.
Width
, clientRectWithPadding.Height);
987
Size preferredSize = GetPreferredSize(new Size(clientRect.
Width
, clientRect.Height));
988
_showToolTip = clientRect.
Width
< preferredSize.Width || clientRect.Height < preferredSize.Height;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (5)
549
box.X = bounds.X + bounds.
Width
- _idealCheckSize - _listItemStartPosition;
572
bounds.
Width
- (_idealCheckSize + (_listItemStartPosition * 2)),
629
textBounds.
Width
- BORDER_SIZE,
715
e.Bounds.
Width
> 2 * BORDER_SIZE && e.Bounds.Height > 2 * BORDER_SIZE)
722
bounds.
Width
- BORDER_SIZE,
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (2)
2357
bounds.Width = MultiColumn ? Math.Max(ColumnWidth, bounds.
Width
) : Math.Max(MaxItemWidth, bounds.
Width
);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
77
bounds.Width = visibleArea.
Width
;
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (3)
103
_ => new Rectangle(point, new Size(itemBounds.
Width
, itemBounds.Height)),
114
new Size(Math.Min(TextRenderer.MeasureText(item.Text, item.Font).Width, itemBounds.
Width
),
131
return new Rectangle(point, new Size(Math.Min(textWidth, itemBounds.
Width
), itemBounds.Height));
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
45
_owningItem.Bounds.
Width
,
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemListAccessibleObject.cs (1)
23
_owningItem.Bounds.
Width
,
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (1)
51
int width = bounds.
Width
;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1661
if (width != oldBounds.
Width
)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (4)
360
result.X += (result.
Width
- _image.Width) / 2;
367
float ratio = Math.Min(ClientRectangle.
Width
/ (float)imageSize.Width, ClientRectangle.Height / (float)imageSize.Height);
370
result.X = (ClientRectangle.
Width
- result.
Width
) / 2;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (3)
1970
if (rc.
Width
< rc.Height)
1972
for (int i = 0; i < rc.
Width
; i++)
1981
ControlPaint.DrawReversibleLine(new Point(rc.X, rc.Y + i), new Point(rc.X + rc.
Width
, rc.Y + i), targetControl.BackColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CategoryGridEntry.cs (2)
137
g.DrawLine(topLinePen, rect.X - 1, rect.Y - 1, rect.
Width
+ 2, rect.Y - 1);
154
g.DrawLine(topLinePen, rect.X - 2, rect.Y - 1, rect.
Width
+ 1, rect.Y - 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (13)
1543
if (paintFullLabel && (neededWidth >= (rect.
Width
- (stringX + 2))))
1561
g.FillRectangle(backBrush, rect.X, rect.Y, rect.
Width
, rect.Height);
1573
stringX, rect.Y, rect.
Width
- stringX - 1, rect.Height);
1576
int maxSpace = Math.Min(rect.
Width
- stringX - 1, labelWidth + PropertyGridView.GdiPlusSpace);
1715
using HBITMAP compatibleBitmap = PInvokeCore.CreateBitmap(rectangle.
Width
, rectangle.Height, (uint)planes, (uint)bitsPixel, lpBits: null);
1719
compatibleDC.HDC.FillRectangle(new Rectangle(0, 0, rectangle.
Width
, rectangle.Height), brush);
1720
explorerTreeRenderer.DrawBackground(compatibleDC, new Rectangle(0, 0, rectangle.
Width
, rectangle.Height), hwnd);
1756
g.DrawRectangle(pen, outline.X, outline.Y, outline.
Width
- 1, outline.Height - 1);
1764
outline.X + outline.
Width
- indent - 1,
1772
outline.X + outline.
Width
/ 2,
1774
outline.X + outline.
Width
/ 2,
1883
if (textWidth >= rect.
Width
|| HasMultipleLines(text))
1908
rect.
Width
- 4,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (5)
120
if (!_lastClientRectangle.IsEmpty && currentClientRectangle.
Width
> _lastClientRectangle.
Width
)
123
_lastClientRectangle.
Width
- 1,
125
currentClientRectangle.
Width
- _lastClientRectangle.
Width
+ 1,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (18)
457
return new Point(point.X + (rect.
Width
/ 2), point.Y + (rect.Height / 2));
619
return new Rectangle(pt.X, pt.Y, rect.
Width
, rect.Height);
895
control.SetBounds(targetRectangle.X, targetRectangle.Y, targetRectangle.
Width
, targetRectangle.Height);
1421
size.Width = Math.Max(rect.
Width
+ 1, size.Width);
1424
rectScreen.X + rectScreen.
Width
- size.Width,
1425
Math.Max(rectScreen.X, location.X + rect.X + rect.
Width
- size.Width));
1968
Size sizeWindow = new(rect.
Width
, rect.Height);
1973
boundsScroll.X = sizeWindow.Width - boundsScroll.
Width
- 1;
3581
if (!_lastClientRect.IsEmpty && newRect.
Width
> _lastClientRect.
Width
)
3583
Rectangle rectInvalidate = new(_lastClientRect.
Width
- 1, 0, newRect.
Width
- _lastClientRect.
Width
+ 1, _lastClientRect.Height);
3589
Rectangle rectInvalidate = new(0, _lastClientRect.Height - 1, _lastClientRect.
Width
, newRect.Height - _lastClientRect.Height + 1);
3725
DropDownListBox.Width = Math.Max(maxWidth, GetRectangle(row, RowValue).
Width
);
3791
int overhang = toolTip.Location.X + toolTip.Size.Width - SystemInformation.VirtualScreen.
Width
;
3965
if (entry.OutlineRectangle.Height != outlineRectIconSize || entry.OutlineRectangle.
Width
!= outlineRectIconSize)
4326
rect.X + rect.
Width
- sizeBtn.Width, rect.Y,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (2)
456
if ((_dragBaseRect.
Width
- delta) > s_minDropDownSize.Width)
459
newBounds.Width = _dragBaseRect.
Width
- delta;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.GridViewTextBox.cs (1)
174
ClientRectangle.
Width
<= PropertyGridView.SelectedGridEntry.GetValueTextWidth(Text, graphics, Font))
System\Windows\Forms\Controls\Splitter\Splitter.cs (9)
413
bounds.X += bounds.
Width
- _splitSize;
420
OnSplitterMoved(new SplitterEventArgs(Left, Top, (Left + bounds.
Width
/ 2), (Top + bounds.Height / 2)));
579
if (r.
Width
< minWeight)
587
if (r.
Width
< minWeight)
592
r.X = bounds.X + bounds.
Width
- splitSize - r.
Width
;
614
DockStyle.Left or DockStyle.Right => r.
Width
,
633
_initTargetSize = target.Bounds.
Width
;
702
PInvoke.PatBlt(dc, r.X, r.Y, r.
Width
, r.Height, ROP_CODE.PATINVERT);
System\Windows\Forms\Controls\TabControl\TabPage.cs (2)
619
inflateRect.
Width
+ 8,
736
base.SetBoundsCore(r.X, r.Y, r.
Width
, r.Height, specified == BoundsSpecified.None ? BoundsSpecified.None : BoundsSpecified.All);
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
396
=> rect.IsEmpty || rect.
Width
<= 0 || rect.Height <= 0;
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (2)
410
else if (item.Bounds.
Width
== 1)
551
TableLayoutSettings.ColumnStyles[0].Width = Math.Max(0, DisplayRectangle.
Width
);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (7)
201
CommonProperties.UpdateSpecifiedBounds(this, bounds.X, bounds.Y, bounds.
Width
, bounds.Height, BoundsSpecified.Location);
2311
maxSize.Width += overflowItemMargin.Horizontal + overflowItem.Bounds.
Width
;
2651
using Bitmap image = new(bounds.
Width
, bounds.Height);
2667
bounds.
Width
,
4182
gripRectangle.X = ClientRectangle.Right - gripRectangle.
Width
- Grip.Margin.Horizontal;
4195
gripRectangle.Width = displayRect.
Width
;
4660
SetBoundsCore(bounds.X, bounds.Y, bounds.
Width
, bounds.Height, specified);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs (2)
142
Point middle = new(dropDownRect.Left + dropDownRect.
Width
/ 2, dropDownRect.Top + dropDownRect.Height / 2);
145
middle.X += (dropDownRect.
Width
% 2);
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (3)
43
CommonProperties.UpdateSpecifiedBounds(c, bounds.X, bounds.Y, bounds.
Width
, bounds.Height);
364
CommonProperties.UpdateSpecifiedBounds(_control, specifiedBounds.X, specifiedBounds.Y, specifiedBounds.
Width
, specifiedBounds.Height);
375
CommonProperties.UpdateSpecifiedBounds(_control, bounds.X, bounds.Y, bounds.
Width
, bounds.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (5)
1028
offset.X = -dropDownBounds.
Width
;
1039
offset.X = -dropDownBounds.
Width
;
1202
SetBoundsCore(bounds.X, bounds.Y, bounds.
Width
, bounds.Height, BoundsSpecified.Location);
1528
base.SetBoundsCore(bounds.X, bounds.Y, bounds.
Width
, bounds.Height, specified);
1765
if (bounds.
Width
> 0 && bounds.Height > 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (2)
38
preferredSize.Width += DropDownArrowRect.
Width
+ _dropDownArrowPadding.Horizontal;
82
_dropDownArrowRect = new Rectangle(0, options.Client.Bottom + _dropDownArrowPadding.Top, _ownerItem.Bounds.
Width
- 1, s_dropDownArrowSize.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (8)
145
if (intersectionBetweenChildAndParent.
Width
>= 2)
151
int newIntersectionWidth = Rectangle.Intersect(GetDropDownBounds(newDropDownDirection), ownerItemBounds).
Width
;
152
if (newIntersectionWidth < intersectionBetweenChildAndParent.
Width
)
307
offset.X = -dropDownBounds.
Width
+ Width;
317
offset.X = -dropDownBounds.
Width
+ Width;
331
offset.X = -dropDownBounds.
Width
;
391
if (Rectangle.Intersect(dropDownBounds, itemScreenBounds).
Width
> 1)
397
if (Rectangle.Intersect(dropDownBounds, itemScreenBounds).
Width
> 1)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (3)
77
int padding = (ShowCheckMargin || ShowImageMargin) ? textPadding + ImageMargin.
Width
: textPadding;
326
maxNonMenuItemSize.Width = Math.Max(item.Bounds.
Width
, maxNonMenuItemSize.Width);
432
int trimPadding = _imageMarginBounds.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (18)
60
int height = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Height : bounds.
Width
;
61
int width = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.
Width
: bounds.Height;
144
g.DrawRectangle(SystemPens.ButtonHighlight, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
190
g.DrawRectangle(SystemPens.ControlLight, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
263
g.DrawRectangle(SystemPens.ButtonHighlight, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
277
g.DrawRectangle(SystemPens.ButtonShadow, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
297
bool oddWidth = ((bounds.
Width
& 0x1) == 0x1);
302
g.DrawLine(p, bounds.X + indent, bounds.Y, bounds.
Width
- 1, bounds.Y);
304
g.DrawLine(p, bounds.X + indent, bounds.Height - 1, bounds.
Width
- 1, bounds.Height - 1);
309
g.DrawLine(p, bounds.
Width
- 1, bounds.Y + indent, bounds.
Width
- 1, bounds.Height - 1);
319
g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.
Width
- 2, 1, 1, 1));
333
g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.
Width
- 2, bounds.Height - 2, 1, 1));
360
int startX = bounds.
Width
/ 2;
367
if (bounds.
Width
>= 4)
420
g.DrawRectangle(SystemPens.ControlLight, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
452
g.DrawRectangle(SystemPens.ControlLight, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
512
g.DrawImage(image, imageRect, 0, 0, imageRect.
Width
, imageRect.Height, GraphicsUnit.Pixel, attrs);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
953
SetBounds(currentBounds.X, currentBounds.Y, currentBounds.
Width
, value);
2006
get => Bounds.
Width
;
3499
return toolStripItemPlacement != ToolStripItemPlacement.Main || bounds.Height <= 0 || bounds.
Width
<= 0;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
985
if (checkRectangle.
Width
!= 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
77
SetBoundsCore(bounds.X, bounds.Y, bounds.
Width
, bounds.Height, specified);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (4)
529
controlLocations[j] = new Point(row.Bounds.
Width
- control.Right, control.Top);
958
cursorLoc.X += toolStripToDrag.GripRectangle.
Width
/ 2;
1024
if (Orientation == Orientation.Horizontal && (bounds.
Width
== 0))
1026
bounds.Width = ParentInternal.DisplayRectangle.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (2)
274
constrainingSize.Width = ToolStripPanelRow.Bounds.
Width
;
315
if (spaceToFree > 0 && bounds.
Width
> spaceToFree)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (5)
464
if (cachedBounds.
Width
> minSize.Width)
466
spaceToFree -= (cachedBounds.
Width
- minSize.Width);
475
cellOffsets[j] += Math.Max(0, currentCell.CachedBounds.
Width
- cachedBounds.
Width
);
676
preferredSize.Width = DisplayRectangle.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (5)
35
displayRect.Width = ToolStripPanel.ParentInternal.DisplayRectangle.
Width
- (ToolStripPanel.Margin.Horizontal + ToolStripPanel.Padding.Horizontal) - Row.Margin.Horizontal;
39
displayRect.Width = raftingDisplayRectangle.
Width
- Row.Margin.Horizontal;
92
return totalSize.Width < DisplayRectangle.
Width
;
290
freedSpace += DisplayRectangle.
Width
;
363
int spaceOccupiedByCell = cell.Margin.Horizontal + cell.Bounds.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (3)
58
int x = previousRowBounds.X + previousRowBounds.
Width
- (previousRowBounds.
Width
>> 2);
68
dragBounds.Width += (nextRowBounds.
Width
>> 2) + Row.Margin.Right + ToolStripPanel.RowsInternal[index + 1].Margin.Left;
System\Windows\Forms\Controls\ToolStrips\ToolStripProfessionalLowResolutionRenderer.cs (7)
62
bool oddWidth = ((bounds.
Width
& 0x1) == 0x1);
67
g.DrawLine(p, bounds.X + indent, bounds.Y, bounds.
Width
- 1, bounds.Y);
69
g.DrawLine(p, bounds.X + indent, bounds.Height - 1, bounds.
Width
- 1, bounds.Height - 1);
74
g.DrawLine(p, bounds.
Width
- 1, bounds.Y + indent, bounds.
Width
- 1, bounds.Height - 1);
84
g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.
Width
- 2, 1, 1, 1));
98
g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.
Width
- 2, bounds.Height - 2, 1, 1));
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (40)
374
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
388
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
429
g.DrawLine(pen, bounds.
Width
- 2, bounds.Height - 2, bounds.
Width
- 1, bounds.Height - 3);
435
g.DrawLine(pen, bounds.
Width
- 1, 0, bounds.
Width
- 1, bounds.Height - 1);
439
g.DrawLine(pen, bounds.
Width
- 2, bounds.Height - 2, bounds.
Width
- 1, bounds.Height - 3);
457
edging = new Rectangle(bounds.
Width
- 1, 3, 1, bounds.Height - 3);
461
edging = new Rectangle(3, bounds.Height - 1, bounds.
Width
- 3, bounds.Height - 1);
488
int height = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Height : bounds.
Width
;
489
int width = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.
Width
: bounds.Height;
548
if ((bounds.
Width
== 0) || (bounds.Height == 0))
588
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
645
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
663
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
854
Point topRight = new(bounds.
Width
- 1, 0);
856
Point bottomRight = new(bounds.
Width
- 1, bounds.Height - 1);
955
if ((bounds.
Width
== 0) || (bounds.Height == 0))
973
endGradient.X = bounds.Right - endGradient.
Width
;
974
useDoubleGradient = (bounds.
Width
> (firstGradientWidth + secondGradientWidth));
1049
e.ImageRectangle.
Width
+ 4, e.ImageRectangle.Height + 2)
1050
: new Rectangle(e.ImageRectangle.Left - 2, 1, e.ImageRectangle.
Width
+ 4, e.Item.Height - 2);
1062
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
1075
g.DrawRectangle(SystemPens.Highlight, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
1081
if ((bounds.
Width
== 0) || (bounds.Height == 0))
1096
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
1199
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
1226
overflowBoundsFill.X += overflowBoundsFill.
Width
- _overflowButtonWidth + 1;
1312
g.FillRectangle(brush, overflowBoundsFill.
Width
- 3, overflowBoundsFill.Top - 1, 1, 1);
1313
g.FillRectangle(brush, overflowBoundsFill.
Width
- 2, overflowBoundsFill.Top - 2, 1, 1);
1345
Point topRight = new(bounds.
Width
- 1, 0);
1406
if ((bounds.
Width
== 0) || (bounds.Height == 0))
1430
if ((bounds.
Width
== 0) || (bounds.Height == 0))
1510
int startX = bounds.
Width
/ 2;
1522
if (isHorizontalSeparatorNotOnDropDownMenu && bounds.
Width
>= 4)
1542
if ((bounds.
Width
== 0) || (bounds.Height == 0))
1596
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
1648
Point middle = new(dropDownRect.Left + dropDownRect.
Width
/ 2, dropDownRect.Top + dropDownRect.Height / 2);
1651
middle.X += dropDownRect.
Width
% 2;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (5)
617
Point middle = new(dropDownRect.Left + dropDownRect.
Width
/ 2, dropDownRect.Top + dropDownRect.Height / 2);
844
e.Graphics.DrawImage(image, imageRect, 0, 0, imageRect.
Width
,
873
if (e.TextDirection != ToolStripTextDirection.Horizontal && textRect.
Width
> 0 && textRect.Height > 0)
984
baseRect.X = sizeGripBounds.
Width
- baseRect.X - baseRect.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderEventArgs.cs (1)
125
return new Rectangle(itemBounds.X + 1, 0, itemBounds.
Width
- 2, 2);
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
268
return new Size(parent.Width - (parent.Padding.Horizontal - dropDownMenu.ImageMargin.
Width
), SeparatorThickness);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
304
int splitButtonButtonWidth = Math.Max(0, Width - dropDownButtonBounds.
Width
);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (1)
208
int widthUnit = orig.
Width
/ 2;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (6)
92
if (currentWidth > _displayRectangle.
Width
- overflowWidth)
94
int spaceRecovered = SendNextItemToOverflow((currentWidth + overflowWidth) - _displayRectangle.
Width
, true);
325
else if (alignedRightItems.
Width
> 0 && alignedLeftItems.
Width
> 0 && alignedRightItems.IntersectsWith(alignedLeftItems))
458
else if (alignedRightItems.
Width
> 0 && alignedLeftItems.
Width
> 0 && alignedRightItems.IntersectsWith(alignedLeftItems))
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (8)
262
e.Graphics.DrawLine(SystemPens.ButtonHighlight, 0, bounds.Bottom - 1, bounds.
Width
, bounds.Bottom - 1);
263
e.Graphics.DrawLine(SystemPens.InactiveBorder, 0, bounds.Bottom - 2, bounds.
Width
, bounds.Bottom - 2);
267
e.Graphics.DrawLine(SystemPens.ButtonHighlight, 0, bounds.Bottom - 1, bounds.
Width
, bounds.Bottom - 1);
268
e.Graphics.DrawLine(SystemPens.ButtonShadow, 0, bounds.Bottom - 2, bounds.
Width
, bounds.Bottom - 2);
317
if (bounds.
Width
>= 4)
467
g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
717
int startX = bounds.
Width
/ 2;
727
if (bounds.
Width
>= 4)
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.cs (1)
93
return new Size(bounds.
Width
, TextBox.PreferredHeight);
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
394
SetBounds(r.X, r.Y, r.Height, r.
Width
, BoundsSpecified.All);
System\Windows\Forms\Controls\TrackBar\TrackBarRenderer.cs (5)
110
if (numTicks <= 0 || bounds.Height <= 0 || bounds.
Width
<= 0 || g is null)
124
float inc = ((float)bounds.
Width
- LineWidth) / ((float)numTicks - 1);
140
if (numTicks <= 0 || bounds.Height <= 0 || bounds.
Width
<= 0 || g is null)
150
t_visualStyleRenderer.DrawEdge(g, new Rectangle(bounds.X, bounds.Y, bounds.
Width
, LineWidth), Edges.Top, edgeStyle, EdgeEffects.None);
160
t_visualStyleRenderer.DrawEdge(g, new Rectangle(bounds.X, (int)Math.Round(y), bounds.
Width
, LineWidth), Edges.Top, edgeStyle, EdgeEffects.None);
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (4)
532
Rectangle clipTop = new(bounds.Left, bounds.Top, bounds.
Width
, border);
534
Rectangle clipBottom = new(bounds.Left, bounds.Bottom - border, bounds.
Width
, border);
838
int totalClientWidth = clientArea.
Width
;
850
upDownEditBounds.Size = new Size(clientArea.
Width
- _defaultButtonsWidth, clientArea.Height);
System\Windows\Forms\Design\ComponentEditorForm.cs (4)
239
pageHostBounds.
Width
, STRIP_HEIGHT);
243
Rectangle pageBounds = new(0, 0, pageHostBounds.
Width
, pageHostBounds.Height);
253
Size size = new(bounds.
Width
+ 3 * (BUTTON_PAD + xFrame) + selectorWidth,
261
bounds.X = bounds.
Width
+ bounds.X - BUTTON_WIDTH;
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (1)
99
int x = screen.X + (screen.
Width
- r.right + r.left) / 2;
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (4)
160
_windowBounds.
Width
,
178
PInvoke.SetViewportOrgEx(hdc, originalOrigin.X + _windowBounds.
Width
- 1, originalOrigin.Y, lppt: null);
201
bounds.
Width
, bounds.Height);
389
_windowBounds.
Width
,
System\Windows\Forms\Form.cs (11)
907
SetDesktopBounds(value.X, value.Y, value.
Width
, value.Height);
1671
if (_restoreBounds.
Width
== -1
3652
cp.X = Math.Max(clientRect.X, clientRect.X + (clientRect.
Width
- cp.Width) / 2);
3677
cp.X = Math.Max(screenRect.X, screenRect.X + (screenRect.
Width
- cp.Width) / 2);
3865
else if (p.X + s.Width > screenRect.X + screenRect.
Width
)
3867
p.X = screenRect.X + screenRect.
Width
- s.Width;
3914
p.X = Math.Max(screenRect.X, screenRect.X + (screenRect.
Width
- Width) / 2);
4480
_dpiFormSizes.Add(e.DeviceDpiNew, new Size(e.SuggestedRectangle.
Width
, e.SuggestedRectangle.Height));
5011
_formStateEx[s_formStateExWindowBoundsWidthIsClientSize] == 1 ? restoredSize.Width : _restoredWindowBounds.
Width
,
5214
if ((specified & BoundsSpecified.Width) != 0 || _restoreBounds.
Width
== -1)
6820
mmi->ptMaxSize.X = maximizedBounds.
Width
;
System\Windows\Forms\Input\Cursor.cs (2)
274
imageWidth = imageRect.
Width
;
287
targetWidth = targetRect.
Width
;
System\Windows\Forms\Internal\WinFormsUtils.cs (3)
82
bounds.Size = new Size(Math.Min(constrainingBounds.
Width
- 2, bounds.
Width
),
91
bounds.X = constrainingBounds.Right - bounds.
Width
;
System\Windows\Forms\Layout\CommonProperties.cs (3)
207
bounds.Width = Math.Min(bounds.
Width
, value.Width);
231
bounds.Width = Math.Max(bounds.
Width
, value.Width);
292
bool wChangedButNotSpecified = ((specified & BoundsSpecified.Width) == BoundsSpecified.None) & width != originalBounds.
Width
;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (2)
1384
float xScaleFactor = (float)suggestedRectangle.
Width
/ Width;
1420
suggestedRectangle.
Width
,
System\Windows\Forms\Layout\Containers\SplitContainer.cs (6)
718
OnSplitterMoved(new SplitterEventArgs(SplitterRectangle.X + SplitterRectangle.
Width
/ 2, SplitterRectangle.Y + SplitterRectangle.Height / 2, SplitterRectangle.X, SplitterRectangle.Y));
991
SplitterCancelEventArgs se = new(Left + SplitterRectangle.X + SplitterRectangle.
Width
/ 2, Top + SplitterRectangle.Y + SplitterRectangle.Height / 2, xSplit, ySplit);
1381
if (r.
Width
< minWeight)
1400
if (r.
Width
< minWeight)
1478
PInvoke.PatBlt(dc, r.X, r.Y, r.
Width
, r.Height, ROP_CODE.PATINVERT);
2285
return new Rectangle(containerRectangle.X + splitterRectangle.X, containerRectangle.Y + splitterRectangle.Y, splitterRectangle.
Width
, splitterRectangle.Height);
System\Windows\Forms\Layout\DefaultLayout.cs (33)
38
proposedConstraints.Width = bounds.
Width
;
57
if (bounds.
Width
< prefSize.Width || bounds.Height < prefSize.Height)
83
Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || (newSize.Height >= oldBounds.Height && newSize.Width >= oldBounds.
Width
),
89
location.X -= newSize.Width - oldBounds.
Width
;
171
int width = bounds.
Width
;
185
width = displayRectangle.
Width
- (anchorInfo.Right + anchorInfo.Left);
194
anchorInfo.Left = displayRectangle.
Width
- width - anchorInfo.Right;
200
int growOrShrink = (displayRectangle.
Width
- (anchorInfo.Left + anchorInfo.Right + width)) / 2;
249
right += displayRect.
Width
;
253
left += displayRect.
Width
;
258
int center = displayRect.
Width
/ 2;
301
if (right < left || cachedBounds.
Width
!= element.Bounds.
Width
|| cachedBounds.X != element.Bounds.X)
308
right = left + Math.Max(element.Bounds.
Width
, cachedBounds.
Width
) + Math.Abs(right);
352
if (CommonProperties.GetAutoSize(container) && ((displayRectangle.
Width
== 0) || (displayRectangle.Height == 0)))
431
remainingBounds.X += element.Bounds.
Width
;
432
remainingBounds.Width -= element.Bounds.
Width
;
444
remainingBounds.Width -= element.Bounds.
Width
;
488
Math.Max(0, newElementBounds.
Width
- remainingBounds.
Width
),
528
(newElementBounds.
Width
< 0 || element.Bounds.
Width
== newElementBounds.
Width
) &&
748
int parentWidth = parentDisplayRect.
Width
;
768
anchorInfo.Left = oldAnchorInfo.Right - cachedBounds.
Width
;
885
anchorInfo.Right = displayRectangle.
Width
- (x + elementBounds.
Width
);
989
widthFactor = ((double)displayRect.
Width
) / anchorInfo.DisplayRectangle.
Width
;
1028
if ((displayRectangle.
Width
== 0) || (displayRectangle.Height == 0))
1152
prefSize.Width = anchorDest.
Width
< 0
1153
? Math.Max(prefSize.Width, elementSpace.Right + anchorDest.
Width
)
System\Windows\Forms\Layout\FlowLayout.ContainerProxy.cs (1)
137
newBounds.X = DisplayRect.Right - bounds.X - bounds.
Width
+ ElementProxy.Margin.Left - ElementProxy.Margin.Right;
System\Windows\Forms\Layout\FlowLayout.cs (6)
76
Rectangle measureBounds = new(displayRect.X, displayRect.Y, displayRect.
Width
, displayRect.Height - layoutSize.Height);
192
elementConstraints.Width = rowBounds.
Width
- rowSize.Width - elementProxy.Margin.Size.Width;
326
Debug.Assert(container.Children[0].Bounds.X == container.DisplayRectangle.X + container.DisplayRectangle.
Width
- container.Children[0].Bounds.
Width
- margin.Right);
348
Debug.Assert(collection[i].Bounds.X + collection[i].Bounds.
Width
<= container.DisplayRectangle.X + container.DisplayRectangle.
Width
);
System\Windows\Forms\Layout\LayoutUtils.cs (15)
226
if (rect1.X <= rect2.X && rect1.X + rect1.
Width
>= rect2.X + rect2.
Width
)
232
if (rect2.X <= rect1.X && rect2.X + rect2.
Width
>= rect1.X + rect1.
Width
)
248
if (rect1.Y <= rect2.Y && rect1.Y + rect1.
Width
>= rect2.Y + rect2.
Width
)
254
if (rect2.Y <= rect1.Y && rect2.Y + rect2.
Width
>= rect1.Y + rect1.
Width
)
294
withinThis.X += withinThis.
Width
- alignThis.Width;
298
withinThis.X += (withinThis.
Width
- alignThis.Width) / 2;
310
withinThis.X += withinThis.
Width
- alignThis.Width;
314
withinThis.X += (withinThis.
Width
- alignThis.Width) / 2;
490
return (rectangle.
Width
== 0 || rectangle.Height == 0);
514
region1.X += bounds.
Width
- specifiedContent.Width;
603
bounds.X = withinBounds.
Width
- bounds.Right;
System\Windows\Forms\Layout\TableLayout.cs (3)
1263
cellBounds.Width = Math.Max(cellBounds.
Width
, 1);
1272
elementBounds.Width = Math.Min(cellBounds.
Width
, elementBounds.
Width
);
System\Windows\Forms\MDI\MDIClient.cs (3)
197
int sw = (int)Math.Round((bounds.X + bounds.
Width
) * dx - sx);
290
using RegionScope rgn1 = new(0, 0, bounds.
Width
, bounds.Height);
294
bounds.
Width
- rect.right,
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (6)
389
outsideCellBounds.
Width
- (cellBorderWidth + 1) / 2,
435
displayRect.
Width
- cellBorderWidth,
453
tableBounds.X + tableBounds.
Width
- 1,
460
tableBounds.X + tableBounds.
Width
- 1,
462
tableBounds.X + tableBounds.
Width
- 1,
468
tableBounds.X + tableBounds.
Width
- 1,
System\Windows\Forms\Printing\PrintPreviewControl.cs (5)
422
internal double HorizontalViewSize => InsideRectangle.
Width
* 100.0 / VirtualSize.Width;
430
rect.Width = Math.Max(0, rect.
Width
- 1);
626
Math.Max(0, (rect.
Width
- _virtualSize.Width) / 2),
802
_hScrollBar.Width = availableRect.
Width
- (verticalScrollNeeded ? _vScrollBar.Width : 0);
807
displayDimension: availableRect.
Width
,
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
1143
Rectangle rect = new(0, 0, item.Bounds.
Width
- 1, item.Bounds.Height - 1);
System\Windows\Forms\Rendering\ControlPaint.cs (82)
87
if (bounds.
Width
> result.
Width
)
89
result.X = (bounds.
Width
- result.
Width
) / 2;
100
float xRatio = bounds.
Width
/ (float)imageSize.Width;
105
result.Width = bounds.
Width
;
125
result.X = (bounds.
Width
- result.
Width
) / 2;
449
imageRectangle.X += clipRect.
Width
- imageRectangle.
Width
;
479
partOfImageToDraw.
Width
,
496
partOfImageToDraw.
Width
,
623
topLineRights[i] = bounds.X + bounds.
Width
- rightOffset - 1;
668
bottomLineRights[i] = bounds.X + bounds.
Width
- rightOffset - 1;
914
bounds.X + bounds.
Width
- 1 - i,
916
bounds.X + bounds.
Width
- 1 - i,
934
bounds.X + bounds.
Width
- 1 - i,
936
bounds.X + bounds.
Width
- 1 - i,
959
bounds.X + bounds.
Width
- 1 - i,
961
bounds.X + bounds.
Width
- 1 - i,
976
rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height,
986
rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height,
995
=> DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, style, sides);
1063
graphics.DrawLine(darkPen, bounds.X, bounds.Y, bounds.X + bounds.
Width
- 1, bounds.Y);
1070
bounds.X, bounds.Y + bounds.Height - 1, bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height - 1);
1073
bounds.X + bounds.
Width
- 1, bounds.Y, bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height - 1);
1077
graphics.DrawLine(mediumPen, bounds.X + 1, bounds.Y + 1, bounds.X + bounds.
Width
- 2, bounds.Y + 1);
1086
bounds.X + 1, bounds.Y + bounds.Height - 2, bounds.X + bounds.
Width
- 2, bounds.Y + bounds.Height - 2);
1089
bounds.X + bounds.
Width
- 2, bounds.Y + 1, bounds.X + bounds.
Width
- 2, bounds.Y + bounds.Height - 2);
1102
graphics.DrawLine(lightPen, bounds.X, bounds.Y, bounds.X + bounds.
Width
- 1, bounds.Y);
1110
bounds.X, bounds.Y + bounds.Height - 1, bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height - 1);
1113
bounds.X + bounds.
Width
- 1, bounds.Y, bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height - 1);
1122
graphics.DrawLine(topLeftPen, bounds.X + 1, bounds.Y + 1, bounds.X + bounds.
Width
- 2, bounds.Y + 1);
1130
bounds.X + 1, bounds.Y + bounds.Height - 2, bounds.X + bounds.
Width
- 2, bounds.Y + bounds.Height - 2);
1133
bounds.X + bounds.
Width
- 2, bounds.Y + 1, bounds.X + bounds.
Width
- 2, bounds.Y + bounds.Height - 2);
1148
bounds = new Rectangle(bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
1177
=> DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1202
rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height,
1225
=> DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1253
=> DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1277
graphics.FillRectangle(brush, bounds.Left + 1, bounds.Top + 1, bounds.
Width
- 2, bounds.Height - 2);
1285
int midx = bounds.X + bounds.
Width
/ 2;
1342
if (rectangle.
Width
< 0 || rectangle.Height < 0)
1348
rectangle.
Width
- 2,
1357
if (t_checkImage is null || t_checkImage.Width != rectangle.
Width
|| t_checkImage.Height != rectangle.Height)
1367
Bitmap bitmap = new(rectangle.
Width
, rectangle.Height);
1386
graphics.DrawRectangle(pen, offsetRectangle.X, offsetRectangle.Y, offsetRectangle.
Width
- 1, offsetRectangle.Height - 1);
1494
rectangle.
Width
- 1,
1671
Point start = new(bounds.X + bounds.
Width
- 1, bounds.Y - 1);
1672
Point end = new(bounds.X + bounds.
Width
- 1, bounds.Y + bounds.Height);
1685
graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.
Width
- 1, rectangle.Height - 1);
1687
graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.
Width
- 1, rectangle.Height - 1);
1691
graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.
Width
- 1, rectangle.Height - 1);
1698
=> DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, glyph);
1711
rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height,
1743
=> DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1760
=> DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1842
=> DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, button, state);
1884
=> DrawSizeGrip(graphics, backColor, bounds.X, bounds.Y, bounds.
Width
, bounds.Height);
2049
PInvoke.PatBlt(desktopDC, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, rop3);
2364
g.DrawLine(SystemPens.Window, bound.X, bound.Y, bound.X + bound.
Width
- 1, bound.Y);
2366
g.DrawLine(SystemPens.ControlDark, bound.X + bound.
Width
- 1, bound.Y, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
2367
g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y + bound.Height - 1, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
2374
bound = new Rectangle(bound.X + 1, bound.Y + 1, bound.
Width
- 1, bound.Height - 1);
2375
g.DrawLine(SystemPens.Window, bound.X, bound.Y, bound.X + bound.
Width
- 1, bound.Y);
2378
g.DrawLine(SystemPens.ControlDark, bound.X + bound.
Width
- 1, bound.Y, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
2379
g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y + bound.Height - 1, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
2383
g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y, bound.X + bound.
Width
- 1, bound.Y);
2385
g.DrawLine(SystemPens.Window, bound.X + bound.
Width
- 1, bound.Y, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
2386
g.DrawLine(SystemPens.Window, bound.X, bound.Y + bound.Height - 1, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
2394
bound = new Rectangle(bound.X + 1, bound.Y + 1, bound.
Width
- 1, bound.Height - 1);
2395
g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y, bound.X + bound.
Width
- 1, bound.Y);
2397
g.DrawLine(SystemPens.Window, bound.X + bound.
Width
- 1, bound.Y, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
2398
g.DrawLine(SystemPens.Window, bound.X, bound.Y + bound.Height - 1, bound.X + bound.
Width
- 1, bound.Y + bound.Height - 1);
System\Windows\Forms\Rendering\TextExtensions.cs (1)
86
if (bounds.
Width
== int.MaxValue)
System\Windows\Forms\Scrolling\HScrollProperties.cs (1)
15
private protected override int GetPageSize(ScrollableControl parent) => parent.ClientRectangle.
Width
;
System\Windows\Forms\Scrolling\ScrollableControl.cs (23)
201
rect.Width = _displayRect.
Width
;
223
displayRectangle.Width = Math.Max(displayRectangle.
Width
, AutoScrollMinSize.Width);
326
int maxX = minClient.
Width
;
455
int ctlRight = -display.X + bounds.X + bounds.
Width
+ _scrollMargin.Width;
484
if (maxX <= fullClient.
Width
)
510
if (needVscroll && maxX > clientToBe.
Width
)
517
maxX = clientToBe.
Width
;
559
_displayRect = new Rectangle(_displayRect.X, _displayRect.Y, _displayRect.
Width
, VerticalScroll.Maximum);
628
int maxPos = -(client.
Width
- _displayRect.
Width
);
749
int minX = Math.Min(client.
Width
- displayRectangle.
Width
, 0);
829
&& (client.
Width
> 0 && client.Height > 0))
869
else if (bounds.X + bounds.
Width
+ xMargin > client.
Width
)
871
xCalc = client.
Width
- (bounds.X + bounds.
Width
+ xMargin - _displayRect.X);
1043
if (_displayRect.
Width
!= width || _displayRect.Height != height)
1050
int minX = ClientRectangle.
Width
- width;
1152
HorizontalScroll._maximum = displayRect.
Width
- 1;
1157
HorizontalScroll._largeChange = ClientRectangle.
Width
;
1358
int maxPos = -(client.
Width
- _displayRect.
Width
);
System\Windows\Forms\ToolTip\ToolTip.cs (8)
1550
int centeredX = toolRectangle.Left + toolRectangle.
Width
/ 2 - width / 2; // tooltip will be aligned with tool vertically
1575
locationWeights[i] += Math.Abs((long)intersection.
Width
* intersection.Height); // Intersection is a weight
1588
locationClippedAreas[i] = (Math.Abs((long)possibleLocations[i].
Width
) - Math.Abs((long)locationAreaWithinScreen.
Width
))
1603
locationWithinTopControlAreas[i] = Math.Abs((long)locationWithinTopControlRectangle.Height * locationWithinTopControlRectangle.
Width
);
2088
? Math.Min(currentTooltipSize.Width - 2 * BalloonOffsetX, screen.WorkingArea.
Width
)
2089
: Math.Min(currentTooltipSize.Width, screen.WorkingArea.
Width
);
2240
PInvokeCore.SendMessage(this, PInvoke.TTM_SETMAXTIPWIDTH, 0, screen.WorkingArea.
Width
);
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (10)
221
if (bounds.
Width
< 0 || bounds.Height < 0)
250
if (bounds.
Width
< 0 || bounds.Height < 0 || clipRectangle.
Width
< 0 || clipRectangle.Height < 0)
304
if (bounds.
Width
< 0 || bounds.Height < 0)
322
if (bounds.
Width
< 0 || bounds.Height < 0)
340
if (bounds.
Width
< 0 || bounds.Height < 0)
381
if (bounds.
Width
< 0 || bounds.Height < 0)
415
if (bounds.
Width
< 0 || bounds.Height < 0)
431
if (contentBounds.
Width
< 0 || contentBounds.Height < 0)
450
if (bounds.
Width
< 0 || bounds.Height < 0)
System.Windows.Forms.Design (110)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (4)
587
Rectangle res = e.Bounds with { X = e.Bounds.X + offset, Width = e.Bounds.
Width
- offset };
599
g.DrawRectangle(SystemPens.ControlText, baseVar.X, baseVar.Y, baseVar.
Width
- 1, baseVar.Height - 1);
617
e.Bounds with { X = e.Bounds.X + offset, Width = e.Bounds.
Width
- offset });
622
if (width > e.Bounds.
Width
&& _listBox.HorizontalExtent < width)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (2)
245
Convert.ToInt32(dropDownRect.Left + dropDownRect.
Width
/ 2),
249
middle.X += (dropDownRect.
Width
% 2);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (3)
348
dropDownSize.Width = Math.Max(editorBounds.
Width
+ 1, dropDownSize.Width);
372
dropDownSize.Width = Math.Max(editorBounds.
Width
+ 1, dropDownSize.Width);
375
Math.Max(rectScreen.X, editorLocation.X - editorBounds.
Width
)); // max = left screen edge clip
System\ComponentModel\Design\DesignerActionUI.cs (1)
616
if ((new Rectangle(glyphCoord, new Size(currentGlyph.Bounds.
Width
, currentGlyph.Bounds.Height))).Contains(point))
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
241
(int)Math.Min(Math.Ceiling(WatermarkSize.Width * 1.75), workingArea.
Width
/ 3),
System\Drawing\Design\ColorEditor.ColorPalette.ColorPaletteAccessibleObject.ColorCellAccessibleObject.cs (1)
43
return new Rectangle(pt.X, pt.Y, rect.
Width
, rect.Height);
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
315
rectTabControl.
Width
- CMARGIN,
System\Drawing\Design\IconEditor.cs (2)
120
if (icon.Width < rectangle.
Width
)
122
rectangle.X += (rectangle.
Width
- icon.Width) / 2;
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (1)
271
e.Graphics.DrawRectangle(SystemPens.WindowFrame, rc.X, rc.Y, rc.
Width
- 1, rc.Height - 1);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (4)
535
Rectangle clipBounds = new(0, 0, rootControl.ClientRectangle.
Width
, rootControl.ClientRectangle.Height);
1020
if (bounds.Left + bounds.
Width
< dragBounds.Left)
1025
else if (dragBounds.Left + dragBounds.
Width
< bounds.Left)
1144
Rectangle tempDragRect = new(dragBounds.Left + snapPoint.X, dragBounds.Top + snapPoint.Y, dragBounds.
Width
, dragBounds.Height);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
1007
int imageWidth = _dragImageRect.
Width
;
System\Windows\Forms\Design\Behavior\GrabHandleGlyph.cs (4)
56
if (controlBounds.
Width
>= (2 * DesignerUtils.s_handleOverlap) + (2 * DesignerUtils.s_handleSize))
58
bounds = new Rectangle(controlBounds.X + (controlBounds.
Width
/ 2) - (DesignerUtils.s_handleSize / 2), controlBounds.Y + DesignerUtils.s_handleOverlap - DesignerUtils.s_handleSize, DesignerUtils.s_handleSize, DesignerUtils.s_handleSize);
68
if (controlBounds.
Width
>= (2 * DesignerUtils.s_handleOverlap) + (2 * DesignerUtils.s_handleSize))
70
bounds = new Rectangle(controlBounds.X + (controlBounds.
Width
/ 2) - (DesignerUtils.s_handleSize / 2), controlBounds.Bottom - DesignerUtils.s_handleOverlap, DesignerUtils.s_handleSize, DesignerUtils.s_handleSize);
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (11)
149
rect.Width = Math.Max(rect.
Width
, _parentGridSize.Width);
619
_resizeComponents[0].resizeBounds.
Width
, _resizeComponents[0].resizeBounds.Height);
625
controlBounds.Offset(-controlBounds.
Width
, 0);
718
bounds.Width = Math.Max(minWidth, baseBounds.
Width
+ (!fRTL ? (mouseLoc.X - xOffset) : (xOffset - mouseLoc.X)));
732
bounds.Width = Math.Max(minWidth, baseBounds.
Width
+ xOffset);
733
if ((bounds.
Width
!= minWidth) ||
734
((bounds.
Width
== minWidth) && (oldBounds.
Width
!= minWidth)))
767
propWidth.SetValue(_resizeComponents[i].resizeControl, bounds.
Width
);
793
control.SetBounds(bounds.X, bounds.Y, bounds.
Width
, bounds.Height, specified);
930
if (propWidth is not null && _resizeComponents[i].resizeControl.Width != _resizeComponents[i].resizeBounds.
Width
)
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionGlyph.cs (6)
108
x = (bounds.
Width
- _imageWidth) / 2;
117
x = (bounds.
Width
- _imageWidth) / 2;
129
_glyphBounds = new Rectangle(bounds.X + bounds.
Width
, bounds.Y + y, _imageHeight, _imageWidth);
157
x = (bounds.
Width
- _imageWidth) / 2;
166
x = (bounds.
Width
- _imageWidth) / 2;
178
_glyphBounds = new Rectangle(bounds.X + bounds.
Width
, bounds.Y + y, _imageHeight, _imageWidth);
System\Windows\Forms\Design\ComponentTray.cs (2)
1860
Point newLoc = new(bounds.X + bounds.
Width
+ _whiteSpace.X, bounds.Y);
2288
int x = rc.X + (rc.
Width
- _cxIcon) / 2;
System\Windows\Forms\Design\ControlCommandSet.cs (1)
725
moveOffsetX = newRect.
Width
- primaryControl.Width;
System\Windows\Forms\Design\ControlDesigner.cs (1)
2253
textRect.X = imageRect.X + imageRect.
Width
+ 2 * marginX;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (3)
1004
int textWidth = Size.Ceiling(e.Graphics.MeasureString(columnName, e.Font!, new SizeF(bounds.
Width
, bounds.Height))).Width;
1021
e.Graphics.FillRectangle(backBrush, new Rectangle(focusRectangle.Right + 1, e.Bounds.Y, e.Bounds.
Width
- focusRectangle.Right - 1, e.Bounds.Height));
1025
e.Graphics.FillRectangle(backBrush, new Rectangle(bounds.X, e.Bounds.Y, e.Bounds.
Width
- bounds.X, e.Bounds.Height));
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
2031
int w = bounds.Left + bounds.
Width
;
System\Windows\Forms\Design\DesignerUtils.cs (4)
462
SelectionBorderGlyphType.Top => new Rectangle(originalBounds.Left - borderSize, originalBounds.Top - borderSize, originalBounds.
Width
+ 2 * borderSize, borderSize),
463
SelectionBorderGlyphType.Bottom => new Rectangle(originalBounds.Left - borderSize, originalBounds.Bottom, originalBounds.
Width
+ 2 * borderSize, borderSize),
590
newBounds.X = originalBounds.X - originalBounds.
Width
+ e.Offset.X;
599
newBounds.X = originalBounds.X - originalBounds.
Width
- e.Offset.X;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
155
bounds.
Width
+ margin.Horizontal,
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
413
if (rectangle.
Width
== 0)
System\Windows\Forms\Design\ParentControlDesigner.cs (16)
567
prop?.SetValue(newChild, new Size(bounds.
Width
, bounds.Height));
812
CreateToolCore(tool, bounds.X, bounds.Y, bounds.
Width
, bounds.Height, true, true);
1047
if (translatedBounds.
Width
< 2 * DesignerUtils.s_containerGrabHandleSize)
1095
adjustedRect.Width = dragRect.
Width
;
1172
updatedRect.Width = ((dragRect.X + dragRect.
Width
) / gridSize.Width) * gridSize.Width - updatedRect.X;
1177
if (updatedRect.
Width
< gridSize.Width)
1785
offset.
Width
, offset.Height);
1825
_statusCommandUI?.SetStatusInformation(new Rectangle(location.X, location.Y, offset.
Width
, offset.Height));
1862
if (offset.
Width
< minControlSize.Width)
1947
if (_mouseDragOffset.
Width
< 0)
1949
_mouseDragOffset.X += _mouseDragOffset.
Width
;
1950
_mouseDragOffset.Width = -_mouseDragOffset.
Width
;
1977
_mouseDragOffset.
Width
, _mouseDragOffset.Height);
2016
_statusCommandUI?.SetStatusInformation(new Rectangle(offset.X, offset.Y, _mouseDragOffset.
Width
, _mouseDragOffset.Height));
2034
Math.Max(displayRect.
Width
, clientRect.
Width
),
System\Windows\Forms\Design\SelectionUIHandler.cs (6)
209
if (finalMove && offset is { X: 0, Y: 0,
Width
: 0, Height: 0 })
260
ctlBounds.lastRequestedWidth += offset.
Width
;
343
newBounds.Width = tempNewBounds.
Width
;
348
newBounds.Width = tempNewBounds.
Width
;
353
bool sizeChanged = (offset.
Width
!= 0 || offset.Height != 0);
454
Size size = new(Math.Max(MinControlWidth, newBounds.
Width
), Math.Max(MinControlHeight, newBounds.Height));
System\Windows\Forms\Design\SelectionUIService.cs (2)
694
delta.Width -= old.
Width
;
696
if (delta.X != 0 || delta.Y != 0 || delta.
Width
!= 0 || delta.Height != 0)
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (16)
157
rect.X = inner.X + inner.
Width
;
166
rect.X += (outer.
Width
- GRABHANDLE_WIDTH) / 2;
176
rect.X = inner.X + inner.
Width
;
273
if (pt.X >= _innerRect.X + _innerRect.
Width
&& pt.X <= _outerRect.X + _outerRect.
Width
)
278
if (pt.X >= _outerRect.X + (_outerRect.
Width
- GRABHANDLE_WIDTH) / 2
279
&& pt.X <= _outerRect.X + (_outerRect.
Width
+ GRABHANDLE_WIDTH) / 2)
287
if (pt.X >= _innerRect.X + _innerRect.
Width
&& pt.X <= _outerRect.X + _outerRect.
Width
)
310
Debug.Assert(!(pt.X >= _innerRect.X + _innerRect.
Width
&& pt.X <= _outerRect.X + _outerRect.
Width
), "Should be handled by right bottom check");
312
if (pt.X >= _outerRect.X + (_outerRect.
Width
- GRABHANDLE_WIDTH) / 2 && pt.X <= _outerRect.X + (_outerRect.
Width
+ GRABHANDLE_WIDTH) / 2)
390
if (pt.X < _outerRect.X || pt.X > _outerRect.X + _outerRect.
Width
)
401
&& pt.X < _innerRect.X + _innerRect.
Width
514
Rectangle rcOuterNew = new(_innerRect.X - GRABHANDLE_WIDTH, _innerRect.Y - GRABHANDLE_HEIGHT, _innerRect.
Width
+ 2 * GRABHANDLE_WIDTH, _innerRect.Height + 2 * GRABHANDLE_HEIGHT);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
192
int watermarkX = rectangle.
Width
/ 2 - (int)g.MeasureString(name, drawFont).Width / 2;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
1136
Rectangle gBounds = new(checkBounds.Left, startLoc - halfSize, checkBounds.
Width
, DesignerUtils.s_resizeGlyphSize);
System\Windows\Forms\Design\TabOrder.cs (1)
286
graphics.DrawRectangle(pen, convertedRectangle.X, convertedRectangle.Y, convertedRectangle.
Width
- 1, convertedRectangle.Height - 1);
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (2)
903
Rectangle textRect = new(classWidth + GdiPlusExtraSpace, 0, bounds.
Width
- (classWidth + GdiPlusExtraSpace), bounds.Height);
904
label.AutoEllipsis = itemTextWidth > textRect.
Width
;
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1372
if (translatedBounds.
Width
< 2 * DesignerUtils.s_containerGrabHandleSize)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (5)
1181
if (_toolStripAdornerWindowService is not null && (dropDown.Width < _dropDownSizeToInvalidate.
Width
|| dropDown.Size.Height < _dropDownSizeToInvalidate.Height))
1373
if (!(dropDownItem.Owner is ToolStripDropDownMenu) && dropDownItem is not null && dropDownItem.Bounds.
Width
< _commitedEditorNode.Bounds.
Width
)
1376
dropDownItem.DropDown.Location = new Point(dropDownItem.DropDown.Location.X + _commitedEditorNode.Bounds.
Width
- dropDownItem.Bounds.
Width
, dropDownItem.DropDown.Location.Y);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (3)
1873
Rectangle drawRect = new(bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
1887
Rectangle drawRect = new(bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
2032
Rectangle drawRect = new(bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
System.Windows.Forms.Primitives (4)
System\Windows\Forms\Automation\UiaTextProvider.cs (2)
94
result[scan++] = rectArray[i].
Width
;
112
result[2] = bounds.
Width
;
System\Windows\Forms\Automation\UiaTextRange.cs (2)
403
if (rectangle.
Width
> 0 && rectangle.Height > 0)
868
if (rect.
Width
> 0 && rect.Height > 0)
System.Windows.Forms.Primitives.Tests (2)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (2)
716
.Returns((Rectangle rect) => new Rectangle(rect.X + 27, rect.Y + 128, rect.
Width
, rect.Height));
798
.Returns((Rectangle rect) => new Rectangle(rect.X + 27, rect.Y + 128, rect.
Width
, rect.Height));
System.Windows.Forms.Tests (170)
System\Windows\Forms\AccessibleObjects\AccessibleObjectTests.cs (6)
636
Assert.Equal(0, accessibleObject.Bounds.
Width
);
702
Assert.Equal(0, accessibleObject.Bounds.
Width
);
721
Assert.Equal(0, accessibleObject.Bounds.
Width
);
740
Assert.Equal(0, accessibleObject.Bounds.
Width
);
2629
point.Offset(bounds.
Width
/ 2, bounds.Height / 2);
2660
point.Offset(bounds.
Width
/ 2, bounds.Height / 2);
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (1)
416
Assert.Equal(itemWidth, actual.
Width
); // All items are the same width
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (2)
69
Assert.Equal(0, accessibleObject.Bounds.
Width
);
104
Assert.Equal(0, accessibleObject.Bounds.
Width
);
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (2)
152
int actualWidth = accessibleObject.Bounds.
Width
;
175
int actualWidth = accessibleObject.Bounds.
Width
;
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (2)
299
int actualWidth = group1AccObj.Bounds.
Width
;
337
int actualWidth = groupAccObj.Bounds.
Width
;
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
657
int actualWidth = accessibleObject.Bounds.
Width
;
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (1)
39
Assert.Equal(217, bounds.
Width
);
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarBodyAccessibleObjectTests.cs (1)
35
Assert.Equal(217, accessibleObject.Bounds.
Width
);
System\Windows\Forms\AccessibleObjects\Panel.PanelAccessibleObjectTests.cs (2)
285
Assert.Equal(boundingRectangle.
Width
, expected.
Width
+ verticalScrollBarWidth);
System\Windows\Forms\AccessibleObjects\TabPage.TabPageAccessibleObjectTests.cs (2)
557
Assert.Equal(boundingRectangle.
Width
, expected.
Width
+ verticalScrollBarWidth);
System\Windows\Forms\AccessibleObjects\ToolStripControlHost.ToolStripHostedControlAccessibleObjectTests.cs (1)
33
(bool)accessibleObject.GetPropertyValue(UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId) || (accessibleObject.Bounds.
Width
> 0 && accessibleObject.Bounds.Height > 0);
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (1)
125
(toolStripItemAccessibleObject.Bounds.
Width
> 0 && toolStripItemAccessibleObject.Bounds.Height > 0));
System\Windows\Forms\ControlPaintTests.cs (26)
769
ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height);
772
ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height);
781
ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, style);
784
ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, style);
793
ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, style, side);
796
ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, style, side);
841
ControlPaint.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
844
ControlPaint.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
925
ControlPaint.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, button, state);
928
ControlPaint.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, button, state);
1005
ControlPaint.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1008
ControlPaint.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1086
ControlPaint.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1089
ControlPaint.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1448
ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, glyph);
1451
ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, glyph);
1460
ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, glyph, foreColor, backColor);
1463
ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, glyph, foreColor, backColor);
1547
ControlPaint.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1550
ControlPaint.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1627
ControlPaint.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1630
ControlPaint.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, state);
1765
ControlPaint.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, button, state);
1768
ControlPaint.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height, button, state);
1885
ControlPaint.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height);
1888
ControlPaint.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.
Width
, rectangle.Height);
System\Windows\Forms\ControlTests.Methods.cs (6)
10404
Assert.True(control.ClientRectangle.
Width
> 0);
10408
Assert.True(control.DisplayRectangle.
Width
> 0);
10420
Assert.True(control.Bounds.
Width
> 0);
10437
Assert.True(control.ClientRectangle.
Width
> 0);
10441
Assert.True(control.DisplayRectangle.
Width
> 0);
10453
Assert.True(control.Bounds.
Width
> 0);
System\Windows\Forms\CursorTests.cs (2)
186
Assert.True(clip.
Width
>= 0);
206
Assert.True(Cursor.Clip.
Width
>= 0);
System\Windows\Forms\DataGridViewCellTests.cs (5)
3230
Assert.Equal(new Rectangle(expected.X, expected.Y, expected.
Width
, expected.Height + 10), cell.BorderWidths(advancedBorderStyle));
3243
Assert.Equal(new Rectangle(expected.X, expected.Y, expected.
Width
+ 10, expected.Height), cell.BorderWidths(advancedBorderStyle));
3261
Assert.Equal(new Rectangle(expected.X, expected.Y, expected.
Width
+ 10, expected.Height + 11), cell.BorderWidths(advancedBorderStyle));
3282
Assert.Equal(new Rectangle(expected.X + 10, expected.Y, expected.
Width
, expected.Height + 11), cell.BorderWidths(advancedBorderStyle));
3298
Assert.Equal(new Rectangle(expected.X, expected.Y, expected.
Width
+ 10, expected.Height), cell.BorderWidths(advancedBorderStyle));
System\Windows\Forms\FormTests.cs (1)
82
Assert.True(control.DisplayRectangle.
Width
> 0);
System\Windows\Forms\HScrollBarTests.cs (3)
32
Assert.True(control.Bounds.
Width
> 0);
43
Assert.True(control.ClientRectangle.
Width
> 0);
65
Assert.True(control.DisplayRectangle.
Width
> 0);
System\Windows\Forms\ListBoxTests.cs (5)
772
Assert.Equal(123, ((Rectangle)rc).
Width
);
5335
Assert.True(rect1.
Width
> 0);
5343
Assert.True(rect2.
Width
> 0);
5365
Assert.True(rect1.
Width
> 0);
5376
Assert.True(rect2.
Width
> 0);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (7)
154
Assert.Equal(expectedWidth, ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().
Width
);
171
int actualWidth = ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().
Width
;
173
Assert.True(columnWidth > ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().
Width
);
187
: listView.GetItemRect(0, ItemBoundsPortion.Label).
Width
;
189
Assert.Equal(expectedWidth, ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().
Width
);
203
: listView.GetItemRect(0, ItemBoundsPortion.Label).
Width
;
205
Assert.Equal(expectedWidth, ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().
Width
);
System\Windows\Forms\ListViewTests.cs (4)
4094
Assert.True(rect1.
Width
> 0);
4101
Assert.True(rect2.
Width
> 0);
4125
Assert.True(rect1.
Width
> 0);
4135
Assert.True(rect2.
Width
> 0);
System\Windows\Forms\MonthCalendarTests.cs (3)
41
Assert.True(control.Bounds.
Width
> 0);
54
Assert.True(control.ClientRectangle.
Width
> 0);
74
Assert.True(control.DisplayRectangle.
Width
> 0);
System\Windows\Forms\ScreenTests.cs (5)
211
Assert.NotEqual(0, screen.Bounds.
Width
);
215
Assert.InRange(screen.WorkingArea.
Width
, 0, screen.Bounds.
Width
);
217
Assert.InRange(screen.WorkingArea.X, screen.Bounds.X, screen.Bounds.X + screen.Bounds.
Width
);
218
Assert.InRange(screen.WorkingArea.Y, screen.Bounds.Y, screen.Bounds.Y + screen.Bounds.
Width
);
System\Windows\Forms\ScrollBarTests.cs (8)
2941
Assert.True(HFirstPageButton(hScrollBar).Bounds.
Width
> 0);
2955
Assert.True(HFirstPageButton(hScrollBar).Bounds.
Width
== 0 || HFirstPageButton(hScrollBar).Bounds.Height == 0);
2985
Assert.True(HLastPageButton(hScrollBar).Bounds.
Width
> 0);
2999
Assert.True(HLastPageButton(hScrollBar).Bounds.
Width
== 0 || HLastPageButton(hScrollBar).Bounds.Height == 0);
3029
Assert.True(VFirstPageButton(vScrollBar).Bounds.
Width
== 0 || VFirstPageButton(vScrollBar).Bounds.Height == 0);
3042
Assert.True(VLastPageButton(vScrollBar).Bounds.
Width
> 0);
3056
Assert.True(VLastPageButton(vScrollBar).Bounds.
Width
== 0 || VLastPageButton(vScrollBar).Bounds.Height == 0);
3086
Assert.True(VFirstPageButton(vScrollBar).Bounds.
Width
> 0);
System\Windows\Forms\SplitterTests.cs (1)
1423
Assert.Equal(control.Left + control.Bounds.
Width
/ 2, e.SplitX);
System\Windows\Forms\StatusStripTests.Rendering.cs (2)
38
Rectangle bitBltBounds = new(bounds.X, 0, bounds.
Width
- 1, bounds.Height - 1);
39
Rectangle polylineBounds = new(bounds.X, 0, bounds.
Width
- 1, 15);
System\Windows\Forms\SystemInformationTests.cs (2)
794
Assert.NotEqual(0, screen.
Width
);
805
Assert.True(workingArea.
Width
> 0);
System\Windows\Forms\TabControlTests.cs (9)
747
Assert.Equal(200 - displayRectangle.X * 2, control.DisplayRectangle.
Width
);
768
Assert.Equal(200 - displayRectangle.X * 2, control.DisplayRectangle.
Width
);
787
Assert.Equal(200 - displayRectangle.X * 2, control.DisplayRectangle.
Width
);
3664
Assert.True(rect1.
Width
> 0);
3670
Assert.True(rect2.X >= rect1.X + rect1.
Width
);
3672
Assert.True(rect2.
Width
> 0);
3696
Assert.True(rect1.
Width
> 0);
3702
Assert.True(rect2.X >= rect1.X + rect1.
Width
);
3704
Assert.True(rect2.
Width
> 0);
System\Windows\Forms\TabPageTests.cs (16)
2216
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.ClientRectangle);
2217
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.DisplayRectangle);
2220
Assert.Equal(expected.X + expected.
Width
, control.Right);
2224
Assert.Equal(expected.
Width
, control.Width);
2246
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.ClientRectangle);
2247
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.DisplayRectangle);
2250
Assert.Equal(expected.X + expected.
Width
, control.Right);
2254
Assert.Equal(expected.
Width
, control.Width);
4818
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.ClientRectangle);
4819
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.DisplayRectangle);
4822
Assert.Equal(expected.X + expected.
Width
, control.Right);
4826
Assert.Equal(expected.
Width
, control.Width);
4848
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.ClientRectangle);
4849
Assert.Equal(new Rectangle(0, 0, expected.
Width
, expected.Height), control.DisplayRectangle);
4852
Assert.Equal(expected.X + expected.
Width
, control.Right);
4856
Assert.Equal(expected.
Width
, control.Width);
System\Windows\Forms\TextBoxRendererTests.cs (3)
46
? Validate.Polygon16(new(new(1, 1), new(bounds.
Width
- 2, bounds.Height - 2)))
76
? Validate.Polygon16(new(new(1, 1), new(bounds.
Width
- 2, bounds.Height - 2)))
112
? Validate.Polygon16(new(new(1, 1), new(bounds.
Width
- 2, bounds.Height - 2)))
System\Windows\Forms\ToolStripButtonTests.cs (4)
1306
Assert.Equal(0, e.ImageRectangle.
Width
);
1324
Assert.True(e.TextRectangle.
Width
>= 0);
1397
Assert.Equal(0, e.ImageRectangle.
Width
);
1415
Assert.True(e.TextRectangle.
Width
>= 0);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
4895
items[i].SetBounds(0, items[i - 1].Bounds.Bottom + 1, items[i].Bounds.
Width
, items[i].Bounds.Height);
System\Windows\Forms\ToolStripItemTests.cs (10)
14563
Assert.Equal(bounds.
Width
, item.Width);
14571
Assert.Equal(bounds.
Width
, item.Width);
14601
Assert.Equal(bounds.
Width
, item.Width);
14611
Assert.Equal(bounds.
Width
, item.Width);
14655
Assert.Equal(bounds.
Width
, item.Width);
14668
Assert.Equal(bounds.
Width
, item.Width);
14729
Assert.Equal(bounds.
Width
, item.Width);
14739
Assert.Equal(bounds.
Width
, item.Width);
14790
Assert.Equal(bounds.
Width
, item.Width);
14803
Assert.Equal(bounds.
Width
, item.Width);
System\Windows\Forms\ToolStripSeparatorTests.cs (8)
1383
Assert.Equal(bounds.
Width
, item.Width);
1391
Assert.Equal(bounds.
Width
, item.Width);
1421
Assert.Equal(bounds.
Width
, item.Width);
1431
Assert.Equal(bounds.
Width
, item.Width);
1551
Assert.Equal(bounds.
Width
, item.Width);
1561
Assert.Equal(bounds.
Width
, item.Width);
1605
Assert.Equal(bounds.
Width
, item.Width);
1615
Assert.Equal(bounds.
Width
, item.Width);
System\Windows\Forms\ToolStripTests.cs (2)
104
Assert.True(control.GripRectangle.
Width
> 0);
258
Assert.True(control.GripRectangle.
Width
> 0);
System\Windows\Forms\ToolStripTests.Rendering.cs (9)
35
Rectangle bitBltBounds = new(bounds.X, bounds.Y, bounds.
Width
- 1, bounds.Height - 1);
39
new(bounds.
Width
- 3, 0, bounds.
Width
, 1),
40
new(bounds.
Width
- 1, 1, bounds.
Width
, 3),
42
new(bounds.
Width
- 1, bounds.Height - 2, bounds.
Width
, bounds.Height - 1),
44
new(bounds.
Width
- 2, bounds.Height - 1, bounds.
Width
, bounds.Height)
System\Windows\Forms\TreeNodeCollectionTests.cs (1)
24
Assert.True(treeNode.Bounds.
Width
> 0);
System\Windows\Forms\TreeNodeTests.cs (2)
461
Assert.True(bounds.
Width
> 0);
483
Assert.True(bounds.
Width
> 0);
System\Windows\Forms\VScrollBarTests.cs (3)
31
Assert.True(control.Bounds.
Width
> 0);
42
Assert.True(control.ClientRectangle.
Width
> 0);
64
Assert.True(control.DisplayRectangle.
Width
> 0);
System.Windows.Forms.UI.IntegrationTests (28)
AnchorLayoutTests.cs (4)
223
button.SetBounds(bounds.X + 5, bounds.Y + 5, bounds.
Width
+ 10, bounds.Height + 10, BoundsSpecified.None);
226
button.SetBounds(bounds.X + 5, bounds.Y + 5, bounds.
Width
+ 10, bounds.Height + 10, BoundsSpecified.All);
230
button.SetBounds(bounds.X + 5, bounds.Y + 5, bounds.
Width
+ 10, bounds.Height + 10);
252
Assert.Equal(expectedWidth, newButtonBounds.
Width
);
ButtonTests.cs (9)
127
.MoveMouseBy(form.DisplayRectangle.
Width
, 0)
130
Assert.True(form.DisplayRectangle.
Width
> originalFormSize.Width);
144
Point mouseDragHandleOnForm = new(form.DisplayRectangle.Left + form.DisplayRectangle.
Width
/ 2, form.DisplayRectangle.Bottom);
155
Assert.Equal(originalFormSize.Width, form.DisplayRectangle.
Width
);
177
.MoveMouseBy(form.DisplayRectangle.
Width
, 0)
180
Assert.True(form.DisplayRectangle.
Width
> originalFormSize.Width);
186
Assert.Equal(originalFormSize.Width - originalButtonPosition.Right, form.DisplayRectangle.
Width
- button.DisplayRectangle.Right);
200
Point mouseDragHandleOnForm = new(form.DisplayRectangle.Left + form.DisplayRectangle.
Width
/ 2, form.DisplayRectangle.Bottom);
211
Assert.Equal(originalFormSize.Width, form.DisplayRectangle.
Width
);
Dpi\FormDpiTests.cs (2)
41
Assert.NotEqual(initialBounds.
Width
, form.Bounds.
Width
);
DragDropTests.cs (4)
199
X = (startCoordinates.X - vscreen.Left) * DesktopNormalizedMax / vscreen.
Width
+ DesktopNormalizedMax / (vscreen.
Width
* 2),
204
X = (endCoordinates.X - vscreen.Left) * DesktopNormalizedMax / vscreen.
Width
+ DesktopNormalizedMax / (vscreen.
Width
* 2),
FormTests.cs (7)
65
int borderSize = (form.Width - form.ClientRectangle.
Width
) / 2;
76
Assert.True(form.Width >= screenWorkingArea.
Width
/ 2);
77
Assert.True(form.Width <= (screenWorkingArea.
Width
/ 2) + (borderSize * 2));
125
int screenMiddleX = screenWorkingArea.X + (screenWorkingArea.
Width
/ 2);
126
int borderSize = (form.Width - form.ClientRectangle.
Width
) / 2;
137
Assert.True(form.Width >= screenWorkingArea.
Width
/ 2);
138
Assert.True(form.Width <= (screenWorkingArea.
Width
/ 2) + (borderSize * 2));
Infra\ScreenshotService.cs (1)
52
int width = primaryScreen.Bounds.
Width
;
ListBoxItemAccessibleObjestTests.cs (1)
30
boundsAfterHandleCreation.
Width
.Should().BeLessOrEqualTo(listBox.Width);
WindowsFormsIntegration (3)
System\Windows\Integration\HostUtils.cs (3)
174
if (control.ClientRectangle.
Width
== 0 || control.ClientRectangle.Height == 0)
179
SD.Bitmap bitmap = new SD.Bitmap(control.ClientRectangle.
Width
, control.ClientRectangle.Height);
197
SD.Bitmap returnBitmap = new SD.Bitmap(childElementHost.ClientRectangle.
Width
, childElementHost.ClientRectangle.Height);
WinFormsControlsTest (2)
CustomComCtl32Button.cs (1)
99
int width = sender.ClientRectangle.
Width
- 10;
TrackBars.cs (1)
43
trackBar1.Width = ClientRectangle.
Width
- trackBar1.Left * 2;