143 writes to Width
System.Windows.Forms (125)
System\Windows\Forms\ActiveX\AxHost.cs (2)
1083
sz.
Width
= (int)pcont.X;
1096
sz.
Width
= phm.X;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
701
pSizel->
Width
= pt.X;
System\Windows\Forms\Control.cs (1)
9836
size.
Width
= (int)Math.Round(size.Width * x);
System\Windows\Forms\Controls\Buttons\Button.cs (1)
101
requiredSize.
Width
+= 14;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
947
proposedSize.
Width
= 0;
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
285
size.
Width
+= _flatSystemStylePaddingWidth;
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
256
size.
Width
+= _flatSystemStylePaddingWidth;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
390
preferredSize.
Width
+= borderAndPaddingWidths + marginWidths + 2 * DATAGRIDVIEWBUTTONCELL_horizontalTextMargin;
394
preferredSize.
Width
= Math.Max(preferredSize.Width, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (8)
663
checkBoxSize.
Width
-= 3;
667
checkBoxSize.
Width
-= 2;
735
preferredSize.
Width
+= borderWidths.X;
743
preferredSize.
Width
= Math.Max(preferredSize.Width,
1170
checkBoxSize.
Width
-= 3;
1174
checkBoxSize.
Width
-= 2;
1185
checkBoxSize.
Width
-= 3;
1190
checkBoxSize.
Width
-= 2;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (9)
541
preferredSize.
Width
+= s_sortGlyphWidth +
545
preferredSize.
Width
+= s_sortGlyphSeparatorWidth;
549
preferredSize.
Width
= Math.Max(preferredSize.Width, 1);
657
preferredSize.
Width
+= s_sortGlyphWidth +
661
preferredSize.
Width
+= s_sortGlyphSeparatorWidth;
667
preferredSize.
Width
= Math.Max(preferredSize.Width, 1);
677
preferredSize.
Width
+= HorizontalTextMarginLeft + HorizontalTextMarginRight;
680
preferredSize.
Width
+= borderAndPaddingWidths;
693
preferredSize.
Width
+= rectThemeMargins.X + rectThemeMargins.Width;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
1188
preferredSize.
Width
= 0;
1197
preferredSize.
Width
+= SystemInformation.HorizontalScrollBarThumbWidth + 1 + (2 * Margin) + borderAndPaddingWidths;
1201
preferredSize.
Width
= Math.Max(
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (3)
508
preferredSize.
Width
= 0;
518
preferredSize.
Width
+= borderAndPaddingWidths;
522
preferredSize.
Width
= Math.Max(preferredSize.Width, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (2)
644
preferredSize.
Width
+= HorizontalTextMarginLeft + HorizontalTextMarginRight + borderAndPaddingWidths;
648
preferredSize.
Width
= Math.Max(preferredSize.Width, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (2)
486
preferredSize.
Width
+= DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginLeft + DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginRight + borderAndPaddingWidths;
490
preferredSize.
Width
= Math.Max(preferredSize.Width, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (5)
271
preferredSize.
Width
+= 2 * ContentMarginWidth +
283
preferredSize.
Width
+= IconsWidth + 2 * IconMarginWidth;
288
preferredSize.
Width
+= IconsWidth + 2 * IconMarginWidth;
297
preferredSize.
Width
+= borderAndPaddingWidths;
333
sizeConstraint.
Width
= sizeCell.Width;
System\Windows\Forms\Controls\Labels\Label.cs (3)
1010
bordersAndPadding.
Width
+= 2; // taken from Everett.PreferredWidth
1036
proposedSize.
Width
= 0;
1070
requiredSize.
Width
= 0;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (6)
1225
_dimensions.
Width
= 1;
1230
_dimensions.
Width
= (nCols < 1) ? 1 : nCols;
1234
minSize.
Width
= (minSize.Width + InsertWidthSize) * _dimensions.Width - InsertWidthSize;
1243
minSize.
Width
= maxTodayWidth;
1248
minSize.
Width
+= _extraPadding;
1787
_dimensions.
Width
= x;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (1)
151
size.
Width
= Math.Max(0, size.Width - 2 * _borderSize);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (4)
1421
size.
Width
= Math.Max(rect.Width + 1, size.Width);
1863
size.
Width
= sizeWindow.Width;
1871
size.
Width
-= sizeScroll.Width;
1874
size.
Width
-= 2;
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
438
scrollBarPadding.
Width
+= SystemInformation.VerticalScrollBarWidth;
System\Windows\Forms\Controls\TextBox\TextBox.cs (1)
412
scrollBarPadding.
Width
+= SystemInformation.GetVerticalScrollBarWidthForDpi(_deviceDpi);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
831
bordersAndPadding.
Width
+= 2;
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
301
proposedSize.
Width
= int.MaxValue;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (6)
2240
proposedSize.
Width
= int.MaxValue;
2290
maxSize.
Width
+= itemMargin.Horizontal + prefItemSize.Width;
2312
maxSize.
Width
+= overflowItemMargin.Horizontal + overflowItem.Bounds.Width;
2316
maxSize.
Width
+= 2; // add Padding of 2 Pixels to the right if not Overflow.
2323
maxSize.
Width
+= gripMargin.Horizontal + toolStrip.Grip.GripThickness;
2350
maxSize.
Width
= Math.Max(maxSize.Width, itemMargin.Horizontal + preferredSize.Width);
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (1)
162
prefSize.
Width
= Math.Max(prefSize.Width, _standardButtonWidth);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (1)
325
preferredSize.
Width
= Math.Max(preferredSize.Width, 75);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (1)
38
preferredSize.
Width
+= DropDownArrowRect.Width + _dropDownArrowPadding.Horizontal;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (7)
298
menuItemTextSize.
Width
+= _tabWidth + shortcutTextSize.Width;
303
maxTextSize.
Width
= Math.Max(maxTextSize.Width, menuItemTextSize.Width);
313
maxImageSize.
Width
= Math.Max(maxImageSize.Width, imageSize.Width);
319
maxCheckSize.
Width
= Math.Max(checkedImageSize.Width, maxCheckSize.Width);
326
maxNonMenuItemSize.
Width
= Math.Max(item.Bounds.Width, maxNonMenuItemSize.Width);
346
maxTextSize.
Width
= Math.Max(maxTextSize.Width, maxNonMenuItemSize.Width);
429
_maxItemSize.
Width
= (_arrowRectangle.Right + _arrowPadding.Right) - _imageMarginBounds.Left;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.ToolStripDropDownLayoutEngine.cs (1)
20
preferredSize.
Width
= dropDownMenu.MaxItemSize.Width - dropDownMenu.PaddingToTrim;
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (1)
93
preferredSize.
Width
= constrainingSize.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
95
constrainingSize.
Width
= 200;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
78
preferredSize.
Width
= Math.Min(constrainingSize.Width, s_maxSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (3)
214
_maxSize.
Width
+= growBy;
272
constrainingSize.
Width
= ToolStripPanelRow.Bounds.Width;
274
preferredSize.
Width
= constrainingSize.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
676
preferredSize.
Width
= DisplayRectangle.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (1)
127
preferredSize.
Width
= (ParentInternal is not null) ? ParentInternal.Width - 2 : preferredSize.Width; // Two for border
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
276
constrainingSize.
Width
= SeparatorHeight;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
350
preferredSize.
Width
+= DropDownButtonWidth + SplitterWidth + Padding.Horizontal;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (1)
467
itemSize.
Width
= Math.Max(toolStripPreferredSize.Width - itemMargin.Horizontal - 1, 0);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (5)
80
_webBrowserBaseChangingSize.
Width
= -1; // Invalid value. Use WebBrowserBase.Bounds instead, when this is the case.
199
_webBrowserBaseChangingSize.
Width
= width;
207
_webBrowserBaseChangingSize.
Width
= -1; // Invalid value. Use WebBrowserBase.Bounds instead, when this is the case.
1118
sz.
Width
= (int)pcont.X;
1130
sz.
Width
= phm.X;
System\Windows\Forms\Design\ComponentEditorForm.cs (1)
354
_maxSize.
Width
= pageSize.Width;
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
225
textSize.
Width
= _scaledMaxTextWidth;
System\Windows\Forms\Form.cs (5)
1219
minimumSize.
Width
= value.Width;
1336
maximumSize.
Width
= value.Width;
3042
correctClientSize.
Width
+= SystemInformation.VerticalScrollBarWidth;
3062
correct.
Width
+= SystemInformation.VerticalScrollBarWidth;
4551
desiredSize.
Width
= (int)(Size.Width * autoScaleFactor.Width);
System\Windows\Forms\Layout\DefaultLayout.cs (8)
39
proposedConstraints.
Width
= bounds.Width;
495
neededSize.
Width
= 0;
542
newSize.
Width
= remainingSize.Width;
546
newSize.
Width
= Math.Max(newSize.Width, remainingSize.Width);
677
preferredSizeForAnchoring.
Width
-= containerPadding.Left;
1130
prefSize.
Width
= Math.Max(prefSize.Width, elementSpace.Right);
1148
prefSize.
Width
= Math.Max(prefSize.Width, anchorInfo is null ? bounds.Right : bounds.Right + anchorInfo.Right);
1153
prefSize.
Width
= anchorDest.Width < 0
System\Windows\Forms\Layout\FlowLayout.cs (3)
93
layoutSize.
Width
= Math.Max(layoutSize.Width, rowSize.Width);
192
elementConstraints.
Width
= rowBounds.Width - rowSize.Width - elementProxy.Margin.Size.Width;
252
rowSize.
Width
= location.X - rowBounds.X;
System\Windows\Forms\Layout\LayoutUtils.cs (7)
51
largestSize.
Width
= Math.Max(largestSize.Width, textSize.Width);
128
size.
Width
= int.MaxValue;
361
stretchedSize.
Width
= withinThis.Width;
399
currentSize.
Width
= Math.Max(currentSize.Width, contentSize.Width);
404
currentSize.
Width
+= contentSize.Width;
456
(size.Height, size.
Width
) = (size.Width, size.Height);
583
currentSize.
Width
-= contentSize.Width;
System\Windows\Forms\Layout\TableLayout.cs (4)
108
containerSize.
Width
= Math.Max(containerSize.Width, 1);
165
containerSize.
Width
= Math.Max(containerSize.Width, 1);
178
proposedConstraints.
Width
= Math.Max(proposedConstraints.Width, 1);
645
preferredSize.
Width
= InflateColumns(containerInfo, proposedConstraints, measureOnly);
System\Windows\Forms\Rendering\TextExtensions.cs (1)
236
proposedSize.
Width
= minWidth;
System\Windows\Forms\Scrolling\ScrollableControl.cs (2)
344
_scrollMargin.
Width
+= Padding.Right;
368
_scrollMargin.
Width
+= current.Size.Width;
System.Windows.Forms.Design (13)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (2)
348
dropDownSize.
Width
= Math.Max(editorBounds.Width + 1, dropDownSize.Width);
372
dropDownSize.
Width
= Math.Max(editorBounds.Width + 1, dropDownSize.Width);
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (2)
158
requestedSize.
Width
+= SystemInformation.VerticalScrollBarWidth;
161
requestedSize.
Width
= Math.Max(requestedSize.Width, MinimumSize.Width);
System\Windows\Forms\Design\CommandSet.cs (3)
2354
itemSize.
Width
= primarySize.Width;
2430
size.
Width
= ((size.Width + (grid.Width / 2)) / grid.Width) * grid.Width;
3355
gridSize.
Width
= 8;
System\Windows\Forms\Design\ComponentTray.cs (1)
2191
minDrag.
Width
= Math.Max(minDrag.Width, minDblClick.Width);
System\Windows\Forms\Design\ControlDesigner.cs (1)
1380
minDrag.
Width
= Math.Max(minDrag.Width, minDblClick.Width);
System\Windows\Forms\Design\DesignerOptions.cs (2)
32
value.
Width
= MinGridSize;
42
value.
Width
= MaxGridSize;
System\Windows\Forms\Design\DesignerUtils.cs (1)
146
s_minDragSize.
Width
= Math.Max(minDrag.Width, minDblClick.Width);
System\Windows\Forms\Design\FormDocumentDesigner.cs (1)
121
size.
Width
+= SystemInformation.VerticalScrollBarWidth;
System.Windows.Forms.Tests (2)
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (2)
348
CalendarDimensions = new Size {
Width
= 2, Height = 2 }
390
CalendarDimensions = new Size {
Width
= 2, Height = 2 }
WindowsFormsIntegration (3)
System\Windows\Integration\HostUtils.cs (3)
44
if (size.Width == 0) { size.
Width
= int.MaxValue; }
52
if (size.Width == 0 || size.Width == 1) { size.
Width
= int.MaxValue; }
61
size.
Width
= 0;
1005 references to Width
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\MyServices\Internal\ProgressDialog.vb (1)
206
LabelInfo.MaximumSize = New Size(ClientSize.
Width
- BORDER_SIZE, 0)
PresentationFramework-SystemDrawing (2)
SystemDrawingExtension.cs (2)
82
width = bitmapData.Size.
Width
;
101
int bitmapwidth = metafile.Size.
Width
;
PresentationUI (2)
MS\Internal\Documents\DialogDivider.cs (1)
54
base.SetBoundsCore(Parent.Location.X, y, Parent.Size.
Width
, 1, specified);
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (1)
1035
cellBounds.X + (cellBounds.Width - boxSize.
Width
) / 2,
System.ComponentModel.TypeConverter (2)
System\Drawing\SizeConverter.cs (2)
75
intConverter.ConvertToString(context, culture, size.
Width
),
85
return new InstanceDescriptor(ctor, new object[] { size.
Width
, size.Height });
System.Drawing.Common.Tests (34)
mono\System.Drawing.Imaging\BmpCodecTests.cs (5)
57
Assert.Equal(173, bmp.Size.
Width
);
123
Assert.Equal(173, bmp.Size.
Width
);
189
Assert.Equal(173, bmp.Size.
Width
);
375
Assert.Equal(173, bmp.Size.
Width
);
506
Assert.Equal(90, bmp.Size.
Width
);
mono\System.Drawing.Imaging\GifCodecTests.cs (1)
54
Assert.Equal(110, bmp.Size.
Width
);
mono\System.Drawing.Imaging\IconCodecTests.cs (6)
91
Assert.Equal(16, bmp.Size.
Width
);
239
Assert.Equal(32, bmp.Size.
Width
);
444
Assert.Equal(48, bmp.Size.
Width
);
666
Assert.Equal(64, bmp.Size.
Width
);
924
Assert.Equal(96, bmp.Size.
Width
);
1858
Assert.Equal(16, bmp.Size.
Width
);
mono\System.Drawing.Imaging\JpegCodecTests.cs (2)
56
Assert.Equal(110, bmp.Size.
Width
);
183
Assert.Equal(110, bmp.Size.
Width
);
mono\System.Drawing.Imaging\PngCodecTests.cs (3)
62
Assert.Equal(288, bmp.Size.
Width
);
264
Assert.Equal(100, bmp.Size.
Width
);
386
Assert.Equal(288, bmp.Size.
Width
);
mono\System.Drawing.Imaging\TiffCodecTests.cs (1)
56
Assert.Equal(173, bmp.Size.
Width
);
System\Drawing\BufferedGraphicsContextTests.cs (6)
35
using BufferedGraphics bufferedGraphics = context.Allocate(graphics, new Rectangle(0, 0, context.MaximumBuffer.
Width
- 1, context.MaximumBuffer.Height - 1));
47
using BufferedGraphics bufferedGraphics = context.Allocate(graphics, new Rectangle(0, 0, context.MaximumBuffer.
Width
+ 1, context.MaximumBuffer.Height + 1));
84
using (BufferedGraphics bufferedGraphics = context.Allocate(hdc, new Rectangle(0, 0, context.MaximumBuffer.
Width
- 1, context.MaximumBuffer.Height - 1)))
106
using (BufferedGraphics bufferedGraphics = context.Allocate(hdc, new Rectangle(0, 0, context.MaximumBuffer.
Width
+ 1, context.MaximumBuffer.Height + 1)))
150
Rectangle largeRectangle = new(0, 0, context.MaximumBuffer.
Width
+ 1, context.MaximumBuffer.Height + 1);
165
Rectangle largeRectangle = new(0, 0, context.MaximumBuffer.
Width
+ 1, context.MaximumBuffer.Height + 1);
System\Drawing\BufferedGraphicsTests.cs (1)
29
BufferedGraphics graphics = context.Allocate(targetGraphics, new Rectangle(0, 0, context.MaximumBuffer.
Width
+ 1, context.MaximumBuffer.Height + 1));
System\Drawing\IconTests.cs (9)
70
using Icon icon = new(Helpers.GetTestBitmapPath(fileName), size.
Width
, size.Height);
71
Assert.Equal(expectedSize.
Width
, icon.Width);
81
Assert.Equal(expectedSize.
Width
, icon.Width);
125
using Icon icon = new(stream, size.
Width
, size.Height);
126
Assert.Equal(expectedSize.
Width
, icon.Width);
137
Assert.Equal(expectedSize.
Width
, icon.Width);
223
using Icon icon = new(sourceIcon, size.
Width
, size.Height);
224
Assert.Equal(expectedSize.
Width
, icon.Width);
236
Assert.Equal(expectedSize.
Width
, icon.Width);
System.Drawing.Primitives (17)
System\Drawing\Point.cs (3)
39
x = sz.
Width
;
113
public static Point Add(Point pt, Size sz) => new Point(unchecked(pt.X + sz.
Width
), unchecked(pt.Y + sz.Height));
118
public static Point Subtract(Point pt, Size sz) => new Point(unchecked(pt.X - sz.
Width
), unchecked(pt.Y - sz.Height));
System\Drawing\PointF.cs (2)
120
public static PointF Add(PointF pt, Size sz) => new PointF(pt.X + sz.
Width
, pt.Y + sz.Height);
125
public static PointF Subtract(PointF pt, Size sz) => new PointF(pt.X - sz.
Width
, pt.Y - sz.Height);
System\Drawing\Rectangle.cs (3)
43
width = size.
Width
;
77
Width = value.
Width
;
259
public void Inflate(Size size) => Inflate(size.
Width
, size.Height);
System\Drawing\Size.cs (9)
47
public static implicit operator SizeF(Size p) => new SizeF(p.
Width
, p.Height);
111
public static bool operator ==(Size sz1, Size sz2) => sz1.
Width
== sz2.
Width
&& sz1.Height == sz2.Height;
121
public static explicit operator Point(Size size) => new Point(size.
Width
, size.Height);
151
new Size(unchecked(sz1.
Width
+ sz2.
Width
), unchecked(sz1.Height + sz2.Height));
163
new Size(unchecked(sz1.
Width
- sz2.
Width
), unchecked(sz1.Height - sz2.Height));
187
public override readonly int GetHashCode() => HashCode.Combine(
Width
, Height);
System.Private.Windows.Core (2)
System\Private\Windows\Core\BinaryFormat\BinaryFormatWriter.cs (1)
188
value.
Width
,
Windows\Win32\Foundation\RECT.cs (1)
12
right = size.
Width
;
System.Private.Windows.GdiPlus (1)
System\Drawing\IIconExtensions.cs (1)
24
size.
Width
,
System.Windows.Forms (583)
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (1)
143
pt.X += size.
Width
;
System\Windows\Forms\ActiveX\AxHost.cs (10)
1076
Point phm = new(sz.
Width
, sz.Height);
1090
PointF pcont = new(sz.
Width
, sz.Height);
1188
width = adjustedSize.
Width
;
1218
width = p.
Width
;
1415
b.Width = p.
Width
;
3257
if (setExtent.
Width
< ocxExtent.
Width
|| setExtent.Height < ocxExtent.Height)
3259
Bounds = new Rectangle(location.X, location.Y, ocxExtent.
Width
, ocxExtent.Height);
3263
Size newSize = SetExtent(setExtent.
Width
, setExtent.Height);
3266
Bounds = new Rectangle(location.X, location.Y, newSize.
Width
, newSize.Height);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (6)
489
PInvoke.SetWindowExtEx(hdcDraw, sWindowExt.
Width
, sWindowExt.Height, lpsz: null);
491
PInvoke.SetViewportExtEx(hdcDraw, sViewportExt.
Width
, sViewportExt.Height, lpsz: null);
700
Point pt = PixelToHiMetric(size.
Width
, size.Height);
1692
Size size = new(HiMetricToPixel(pSizel->
Width
, pSizel->Height));
1703
Size adjusted = new(size.
Width
, size.Height);
1704
bounds.Width = adjusted.
Width
;
System\Windows\Forms\Control.cs (7)
358
_width = defaultSize.
Width
;
1177
set => SetClientSizeCore(value.
Width
, value.Height);
3014
set => SetBounds(_x, _y, value.
Width
, value.Height, BoundsSpecified.Size);
5185
return ApplyBoundsConstraints(0, 0, proposedSize.
Width
, proposedSize.Height).Size;
9786
SetBoundsCore(rawScaledBounds.X, rawScaledBounds.Y, scaledSize.
Width
, scaledSize.Height, BoundsSpecified.All);
9836
size.Width = (int)Math.Round(size.
Width
* x);
10655
return _width != s.
Width
|| _height != s.Height;
System\Windows\Forms\Control.MetafileDCWrapper.cs (2)
33
if (size.
Width
< 0 || size.Height < 0)
44
_hBitmap = PInvokeCore.CreateBitmap(size.
Width
, size.Height, (uint)planes, (uint)bitsPixel, lpBits: null);
System\Windows\Forms\Controls\Buttons\Button.cs (1)
92
if (_systemSize.
Width
== InvalidDimensionValue)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (2)
945
if (proposedSize.
Width
== 1)
1183
ShowToolTip = (ClientRectangle.Width < preferredSize.
Width
|| ClientRectangle.Height < preferredSize.Height);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (9)
122
xCompose(hComposition, checkSize.
Width
, imageSize.
Width
, textSize.
Width
),
153
xDecompose(hComposition, checkSize.
Width
, imageSize.
Width
, proposedSize.
Width
),
499
size = new Size(size.
Width
+ 1, size.Height + 1);
595
if (textImageRelation == TextImageRelation.ImageBeforeText && layout.ImageBounds.Size.
Width
!= 0)
671
screen.Graphics.MeasureString(Text, Font, new SizeF(proposedSize.
Width
, proposedSize.Height),
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (1)
127
Control.HWNDInternal).
Width
;
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonStandardAdapter.cs (1)
70
b.HWNDInternal).
Width
;
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
198
pt.X += size.
Width
;
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
663
set => base.MaximumSize = new Size(value.
Width
, 0);
669
set => base.MinimumSize = new Size(value.
Width
, 0);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
1115
return Application.RenderWithVisualStyles ? 1 : SystemInformation.Border3DSize.
Width
;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (18)
2020
: TopLeftHeaderCell.GetPreferredSize(-1).
Width
;
2032
: Math.Max(preferredWidth, Rows.SharedRow(rowIndex).HeaderCell.GetPreferredSize(rowIndex).
Width
);
2049
: Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndex).
Width
);
2066
: Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndex).
Width
);
2083
: Math.Max(preferredWidth, Rows.SharedRow(rowIndex).HeaderCell.GetPreferredSize(rowIndex).
Width
);
2182
: TopLeftHeaderCell.GetPreferredSize(-1).
Width
;
2194
: Math.Max(preferredWidth, Rows.SharedRow(rowIndexTmp).HeaderCell.GetPreferredSize(rowIndexTmp).
Width
);
2211
: Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndexTmp).
Width
);
2228
: Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndexTmp).
Width
);
2245
: Math.Max(preferredWidth, Rows.SharedRow(rowIndexTmp).HeaderCell.GetPreferredSize(rowIndexTmp).
Width
);
5789
if (Math.Abs(dgvcme.X - _lastMouseClickInfo.X) <= hotDoubleClickZone.
Width
/ 2
8982
int bordersAndPaddingWidth = 2 * (BorderWidth + Padding.Size.
Width
);
8999
int preferredWidth = Math.Min(minimumWidth + Columns.GetColumnsWidth(DataGridViewElementStates.Visible), proposedConstraints.
Width
);
12703
if (Math.Abs(_ptMouseDownGridCoord.X - ptGridCoord.X) >= s_dragSize.
Width
18831
Invalidate(new Rectangle(new Point(ClientSize.
Width
- (pt.X - rect.Right) - step, ColumnHeadersHeight),
18839
new Size(-step, ClientSize.
Width
)));
18846
new Size(ClientSize.
Width
, ClientSize.Height - (pt.Y - rect.Bottom) - step)));
30053
PInvokeCore.SendMessage(nmhdr->hwndFrom, PInvoke.TTM_SETMAXTIPWIDTH, 0, SystemInformation.MaxWindowTrackSize.
Width
);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (6)
338
MeasureTextSize(graphics, formattedString, cellStyle.Font!, flags).
Width
,
348
constraintSize.
Width
- borderAndPaddingWidths - marginWidths - 2 * DATAGRIDVIEWBUTTONCELL_horizontalTextMargin > 0)
356
constraintSize.
Width
- borderAndPaddingWidths - marginWidths - 2 * DATAGRIDVIEWBUTTONCELL_horizontalTextMargin,
394
preferredSize.Width = Math.Max(preferredSize.
Width
, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
757
valBounds.Inflate(-SystemInformation.Border3DSize.
Width
, -SystemInformation.Border3DSize.Height);
884
valBounds.Width > 2 * SystemInformation.Border3DSize.
Width
+ 1 &&
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (16)
1683
if (constraintSize.
Width
< 0 || constraintSize.Height < 0)
1688
if (constraintSize.
Width
== 0)
2329
widthTruncated = size.
Width
> maxWidth;
2345
return GetPreferredSize(screen, dataGridViewCellStyle, rowIndex, new Size(0, height)).
Width
;
2553
widthTruncated = (requiredSize.
Width
> maxWidth);
2580
if (textOneLineSize.
Width
/ textOneLineSize.Height <= maxRatio)
2586
float maxWidth = textOneLineSize.
Width
* textOneLineSize.
Width
/ (float)textOneLineSize.Height / maxRatio * 1.1F;
2592
if (textSize.
Width
/ textSize.Height <= maxRatio || textSize.
Width
> (int)maxWidth)
2597
maxWidth = textSize.
Width
* 0.9F;
2636
return oneLineSize.
Width
;
2641
int lastFittingWidth = oneLineSize.
Width
;
2648
if (textSize.Height > maxHeight || textSize.
Width
> (int)maxWidth)
2655
maxWidth = textSize.
Width
* 0.9F;
3956
int requiredHeight = MeasureTextHeight(graphics, text, font, maxBounds.
Width
, flags, out bool widthTruncated);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (26)
676
preferredSize = new Size(checkBoxSize.
Width
+ borderAndPaddingWidths + 2 * DATAGRIDVIEWCHECKBOXCELL_margin, 0);
688
preferredSize = new Size(checkBoxSize.
Width
+ borderAndPaddingWidths + 2 * DATAGRIDVIEWCHECKBOXCELL_margin,
698
FlatStyle.Flat => CheckBoxRenderer.GetGlyphSize(graphics, CheckBoxState.UncheckedNormal).
Width
- 3,
699
FlatStyle.Popup => CheckBoxRenderer.GetGlyphSize(graphics, CheckBoxState.UncheckedNormal).
Width
- 2,
701
_ => SystemInformation.Border3DSize.
Width
* 2 + 9 + 2 * DATAGRIDVIEWCHECKBOXCELL_margin,
743
preferredSize.Width = Math.Max(preferredSize.
Width
,
1194
checkBoxSize = new Size(SystemInformation.Border3DSize.
Width
* 2 + 9, SystemInformation.Border3DSize.
Width
* 2 + 9);
1199
if (valBounds.Width >= checkBoxSize.
Width
&& valBounds.Height >= checkBoxSize.Height && (paint || computeContentBounds))
1207
checkBoxX = valBounds.Right - checkBoxSize.
Width
;
1211
checkBoxX = valBounds.Left + (valBounds.Width - checkBoxSize.
Width
) / 2;
1237
new Rectangle(checkBoxX, checkBoxY, checkBoxSize.
Width
, checkBoxSize.Height),
1241
resultBounds = new Rectangle(checkBoxX, checkBoxY, checkBoxSize.
Width
, checkBoxSize.Height);
1255
checkBoxSize.
Width
,
1265
checkBoxSize.
Width
,
1271
resultBounds = new Rectangle(checkBoxX, checkBoxY, checkBoxSize.
Width
, checkBoxSize.Height);
1278
Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.
Width
, checkBoxSize.Height);
1336
Rectangle fullSize = new(checkBoxX - 1, checkBoxY - 1, checkBoxSize.
Width
+ 3, checkBoxSize.Height + 3);
1384
Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.
Width
- 1, checkBoxSize.Height - 1);
1394
checkBoxSize.
Width
,
1423
checkBoxSize.
Width
,
1443
checkBoxSize.
Width
,
1473
checkBoxSize.
Width
,
1490
checkBoxSize.
Width
,
1520
checkBoxSize.
Width
,
1548
Debug.Assert(valBounds.Width < checkBoxSize.
Width
|| valBounds.Height < checkBoxSize.Height, "the bounds are empty");
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (4)
938
preferredCellThickness = HeaderCell.GetPreferredSize(-1).
Width
;
960
preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).
Width
;
984
preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).
Width
;
1009
preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).
Width
;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (7)
532
flags).
Width
,
549
preferredSize.Width = Math.Max(preferredSize.
Width
, 1);
555
int allowedWidth = constraintSize.
Width
- borderAndPaddingWidths;
576
if (glyphSize.
Width
> 0 &&
581
glyphSize.
Width
> 0)
593
glyphSize.
Width
,
667
preferredSize.Width = Math.Max(preferredSize.
Width
, 1);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (7)
537
Size adjustedSize = new(size.
Width
- borderAndPaddingWidths.X - borderAndPaddingWidths.Width,
546
int dropWidth = Math.Min(SystemInformation.HorizontalScrollBarThumbWidth, adjustedSize.
Width
- 2 * Margin - 1);
562
if (x >= size.
Width
- borderAndPaddingWidths.Width - dropWidth - 1 &&
563
x <= size.
Width
- borderAndPaddingWidths.Width - 1)
607
if (preferredSize.
Width
> maxPreferredWidth)
609
maxPreferredWidth = preferredSize.
Width
;
1202
preferredSize.
Width
,
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (3)
428
int imgWidthAllowed = constraintSize.
Width
- borderAndPaddingWidths;
440
int icoWidthAllowed = constraintSize.
Width
- borderAndPaddingWidths;
522
preferredSize.Width = Math.Max(preferredSize.
Width
, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (3)
593
Math.Max(1, constraintSize.
Width
- borderAndPaddingWidths - HorizontalTextMarginLeft - HorizontalTextMarginRight),
617
MeasureTextSize(graphics, formattedString, cellStyle.Font!, flags).
Width
,
648
preferredSize.Width = Math.Max(preferredSize.
Width
, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (3)
439
Math.Max(1, constraintSize.
Width
- borderAndPaddingWidths - DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginLeft - DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginRight),
463
MeasureTextSize(graphics, formattedString, cellStyle.Font!, flags).
Width
,
490
preferredSize.Width = Math.Max(preferredSize.
Width
, borderAndPaddingWidths + IconMarginWidth * 2 + s_iconsWidth);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (12)
180
preferredWidth = DataGridViewCell.MeasureTextSize(graphics, val, cellStyle.Font!, flags).
Width
;
208
int allowedWidth = constraintSize.
Width
- borderAndPaddingWidths;
323
if (sizeRequired.
Width
> cellBounds.Width)
331
if (sizeConstraint.
Width
> sizeCell.
Width
)
333
sizeConstraint.Width = sizeCell.
Width
;
397
ptTextLocation.X = cellBounds.X + (cellBounds.Width - sizeText.
Width
) / 2;
402
ptTextLocation.X = cellBounds.Right - sizeText.
Width
;
412
ptTextLocation.X = cellBounds.X + (cellBounds.Width - sizeText.
Width
) / 2;
417
ptTextLocation.X = cellBounds.Right - sizeText.
Width
;
427
ptTextLocation.X = cellBounds.X + (cellBounds.Width - sizeText.
Width
) / 2;
432
ptTextLocation.X = cellBounds.Right - sizeText.
Width
;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (3)
166
Math.Max(size.
Width
- padding.Horizontal, 0),
537
textLeft += textRectangle.Width - textSize.
Width
;
541
int textRight = Math.Min(textLeft + textSize.
Width
, Width - 6);
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (2)
188
textBounds.Width = measuredBounds.
Width
;
291
textBounds.Width = measuredBounds.
Width
;
System\Windows\Forms\Controls\ImageList\ImageList.cs (14)
157
if (value.
Width
<= 0 || value.
Width
> s_maxImageWidth)
159
throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(SR.InvalidBoundArgument, "ImageSize.Width", value.
Width
, 1, s_maxImageWidth));
167
if (_imageSize.
Width
!= value.
Width
|| _imageSize.Height != value.Height)
169
_imageSize = new Size(value.
Width
, value.Height);
323
if (size.
Width
== 0 || (size.
Width
% _imageSize.
Width
) != 0)
516
public void Draw(Graphics g, int x, int y, int index) => Draw(g, x, y, _imageSize.
Width
, _imageSize.Height, index);
631
result = new Bitmap(_imageSize.
Width
, _imageSize.Height, PixelFormat.Format32bppArgb);
632
targetData = result.LockBits(new Rectangle(0, 0, _imageSize.
Width
, _imageSize.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
659
result = new Bitmap(_imageSize.
Width
, _imageSize.Height);
673
_imageSize.
Width
,
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (2)
394
if (value.Width == 0 || (value.Width % _owner.ImageSize.
Width
) != 0)
404
int nImages = value.Width / _owner.ImageSize.
Width
;
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (1)
38
himl = PInvoke.ImageList_Create(imageSize.
Width
, imageSize.Height, flags, InitialCapacity, GrowBy);
System\Windows\Forms\Controls\Labels\Label.cs (9)
652
public virtual int PreferredWidth => PreferredSize.
Width
;
882
xLoc = (r.X + r.Width - 4) - pointImageSize.
Width
;
886
xLoc = r.X + (r.Width - pointImageSize.
Width
) / 2;
902
return new Rectangle(xLoc, yLoc, pointImageSize.
Width
, pointImageSize.Height);
1034
if (proposedSize.
Width
== 1)
1082
SizeF bounds = (proposedConstraints.
Width
== 1) ?
1084
new SizeF(proposedConstraints.
Width
, proposedConstraints.Height);
1273
_showToolTip = (clientRect.Width < preferredSize.
Width
|| clientRect.Height < preferredSize.Height);
1394
width = preferredSize.
Width
;
System\Windows\Forms\Controls\Labels\LinkLabel.cs (3)
583
textSize.
Width
- iRightMargin - iLeftMargin,
988
_showToolTip = clientRect.Width < preferredSize.
Width
|| clientRect.Height < preferredSize.Height;
1073
focusRectangle.Width = requiredSize.
Width
;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
528
_idealCheckSize = CheckBoxRenderer.GetGlyphSize(e, cbState, HWNDInternal).
Width
;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (4)
604
Size = new Size(oldSize.
Width
+ 1, oldSize.Height);
768
width = SizeFromClientSize(new Size(MaxItemWidth, height)).
Width
;
1308
return Math.Max(oldMax, textSize.
Width
);
2327
Rectangle rect = new(0, 0, Size.
Width
- 1, Size.Height - 1);
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (1)
142
int padding = TextRenderer.MeasureText(" ", Font).
Width
;
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (1)
106
resultBounds = new Rectangle(originalBounds.X, originalBounds.Y, textSize.
Width
, textSize.Height);
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (1)
140
int padding = TextRenderer.MeasureText(" ", font).
Width
;
System\Windows\Forms\Controls\ListView\ListView.cs (4)
1670
if (value.Height <= 0 || value.
Width
<= 0)
5475
int textWidth = Size.Ceiling(g.MeasureString(text, Font)).
Width
;
6822
PInvokeCore.SendMessage(nmhdr->hwndFrom, PInvoke.TTM_SETMAXTIPWIDTH, (WPARAM)0, (LPARAM)SystemInformation.MaxWindowTrackSize.
Width
);
6899
Rectangle rect = new(0, 0, Size.
Width
- 1, Size.Height - 1);
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (3)
114
new Size(Math.Min(TextRenderer.MeasureText(item.Text, item.Font).
Width
, itemBounds.Width),
123
int textWidth = TextRenderer.MeasureText(item.Text, item.Font).
Width
;
128
textWidth = Math.Max(TextRenderer.MeasureText(subItem.Text, subItem.Font).
Width
, textWidth);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (10)
282
SetCalendarDimensions(value.
Width
, value.Height);
1223
if (minSize.
Width
== 0)
1229
int nCols = (newDimensionLength - _extraPadding) / minSize.
Width
;
1234
minSize.Width = (minSize.
Width
+ InsertWidthSize) * _dimensions.
Width
- InsertWidthSize;
1241
if (maxTodayWidth > minSize.
Width
)
1289
return preferredSize.
Width
;
1663
if (width > max.
Width
)
1665
width = max.
Width
;
1785
if (_dimensions.
Width
!= x || _dimensions.Height != y)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (2)
368
float ratio = Math.Min(ClientRectangle.Width / (float)imageSize.
Width
, ClientRectangle.Height / (float)imageSize.Height);
369
result.Width = (int)(imageSize.
Width
* ratio);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.cs (1)
62
return new Rectangle(4, 4, size.
Width
- 8, size.Height - 8);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridToolTip.cs (1)
142
(LPARAM)SystemInformation.MaxWindowTrackSize.
Width
);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (3)
151
size.Width = Math.Max(0, size.
Width
- 2 * _borderSize);
157
size.
Width
,
164
size.
Width
,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (36)
951
return new Bitmap(size.
Width
, size.Height);
1073
return _location.X + GetEntryLabelIndent(gridEntry) + size.
Width
;
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
));
1454
_dropDownHolder.SetBounds(location.X, location.Y, size.
Width
, size.Height);
1653
if (x < 0 || x > size.
Width
+ _location.X)
1857
if (size.
Width
== 0)
1860
if (sizeWindow.
Width
> 10)
1863
size.Width = sizeWindow.
Width
;
1871
size.Width -= sizeScroll.
Width
;
1892
rect.Width = size.
Width
- 1;
1902
rect.Width = size.
Width
- LabelWidth;
1973
boundsScroll.X = sizeWindow.
Width
- boundsScroll.Width - 1;
2099
int widthPS = GetOurSize().
Width
;
2121
Invalidate(new Rectangle(left, 0, Size.
Width
- left, Size.Height));
2210
if ((Size.
Width
> doubleOffset) && (Size.Height > doubleOffset))
2213
ControlPaint.DrawFocusRectangle(g, new Rectangle(_offset2Units, _offset2Units, Size.
Width
- doubleOffset, Size.Height - doubleOffset));
2359
Rectangle clearRect = new(1, 1, Size.
Width
- 2, Size.Height - 2);
2596
if (Math.Abs(screenPoint.X - _rowSelectPos.X) < SystemInformation.DoubleClickSize.
Width
&&
3308
int lineEnd = location.X + size.
Width
;
3350
Rectangle clearRect = new(1, yPosition, Size.
Width
- 2, Size.Height - yPosition - 1);
3358
g.DrawRectangle(borderPen, 0, 0, sizeWindow.
Width
- 1, sizeWindow.Height - 1);
3708
maxWidth = Math.Max(textSize.
Width
, maxWidth);
3791
int overhang = toolTip.Location.X + toolTip.Size.
Width
- SystemInformation.VirtualScreen.Width;
4326
rect.X + rect.Width - sizeBtn.
Width
, rect.Y,
4327
sizeBtn.
Width
, rect.Height);
4331
rect.Width -= sizeBtn.
Width
;
4427
if (size.
Width
>= 0)
4430
_labelWidth = _location.X + (int)(size.
Width
/ _labelRatio);
4446
if (adjustWidth && size.
Width
>= 0)
4448
_labelRatio = GetOurSize().
Width
/ (double)(oldWidth - _location.X);
4827
if (_labelWidth != -1 && size.
Width
> 0)
4829
if (_labelWidth > _location.X + size.
Width
)
4831
_labelWidth = _location.X + (int)(size.
Width
/ _labelRatio);
4835
_labelRatio = GetOurSize().
Width
/ (double)(_labelWidth - _location.X);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
456
if ((_dragBaseRect.Width - delta) > s_minDropDownSize.
Width
)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
672
_maxSize = clientSize.
Width
- dockWidth - _minExtra;
System\Windows\Forms\Controls\TabControl\TabControl.cs (4)
520
if (value.
Width
< 0 || value.Height < 0)
939
PInvokeCore.SendMessage(this, PInvoke.TCM_SETITEMSIZE, 0, PARAM.FromLowHigh(_itemSize.
Width
, _itemSize.Height));
1521
Size = new Size(size.
Width
+ 1, size.Height);
2086
PInvokeCore.SendMessage(nmhdr->hwndFrom, PInvoke.TTM_SETMAXTIPWIDTH, 0, SystemInformation.MaxWindowTrackSize.
Width
);
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (1)
2899
Rectangle rect = new(0, 0, Size.
Width
- 1, Size.Height - 1);
System\Windows\Forms\Controls\TextBox\TextBox.cs (1)
826
Rectangle rect = new(0, 0, Size.
Width
- 1, Size.Height - 1);
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
347
pt.X += size.
Width
;
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (3)
24
if (_cachedHDCSize.
Width
< bitmapSize.
Width
34
_cachedItemBitmap = PInvokeCore.CreateCompatibleBitmap(toolStripHDC, bitmapSize.
Width
, bitmapSize.Height);
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (3)
220
return new Rectangle(statusStripSize.
Width
- GripWidth, statusStripSize.Height - gripHeight, GripWidth, gripHeight);
299
if (proposedSize.
Width
== 1)
375
noMansLand.X += ClientSize.
Width
+ 1;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (6)
2238
if (proposedSize.
Width
== 1)
2290
maxSize.Width += itemMargin.Horizontal + prefItemSize.
Width
;
2350
maxSize.Width = Math.Max(maxSize.
Width
, itemMargin.Horizontal + preferredSize.
Width
);
3555
item.Size.
Width
,
3573
item.Size.
Width
,
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (1)
162
prefSize.Width = Math.Max(prefSize.
Width
, _standardButtonWidth);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (1)
325
preferredSize.Width = Math.Max(preferredSize.
Width
, 75);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (3)
59
int widthOfDropDown = s_dropDownArrowSize.
Width
+ _dropDownArrowPadding.Horizontal;
66
_dropDownArrowRect = new Rectangle(_dropDownArrowPadding.Left, 0, s_dropDownArrowSize.
Width
, _ownerItem.Bounds.Height);
71
_dropDownArrowRect = new Rectangle(options.Client.Right, 0, s_dropDownArrowSize.
Width
, _ownerItem.Bounds.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (16)
295
_tabWidth = TextRenderer.MeasureText("\t", Font).
Width
;
298
menuItemTextSize.Width += _tabWidth + shortcutTextSize.
Width
;
303
maxTextSize.Width = Math.Max(maxTextSize.
Width
, menuItemTextSize.
Width
);
313
maxImageSize.Width = Math.Max(maxImageSize.
Width
, imageSize.
Width
);
319
maxCheckSize.Width = Math.Max(checkedImageSize.
Width
, maxCheckSize.
Width
);
326
maxNonMenuItemSize.Width = Math.Max(item.Bounds.Width, maxNonMenuItemSize.
Width
);
346
maxTextSize.Width = Math.Max(maxTextSize.
Width
, maxNonMenuItemSize.
Width
);
351
int extraImageWidth = Math.Max(0, maxImageSize.
Width
- _defaultImageSize.
Width
);
364
_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, maxCheckSize.
Width
, _maxItemSize.Height), ContentAlignment.MiddleCenter);
369
_imageRectangle = LayoutUtils.Align(maxImageSize, new Rectangle(nextPoint.X, nextPoint.Y, maxImageSize.
Width
, _maxItemSize.Height), ContentAlignment.MiddleCenter);
438
int width = _maxItemSize.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.ToolStripDropDownLayoutEngine.cs (1)
20
preferredSize.Width = dropDownMenu.MaxItemSize.
Width
- dropDownMenu.PaddingToTrim;
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (4)
91
if (preferredSize.
Width
> constrainingSize.
Width
)
93
preferredSize.Width = constrainingSize.
Width
;
140
if (deltaX >= s_dragSize.
Width
)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.ToolStripItemLayoutOptions.cs (2)
24
|| _cachedSize.
Width
<= proposedConstraints.
Width
))
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
78
preferredSize.Width = Math.Min(constrainingSize.
Width
, s_maxSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (9)
193
if (MaximumSize.
Width
>= Control.PreferredSize.
Width
)
202
if (MaximumSize.
Width
+ growBy >= Control.PreferredSize.
Width
)
204
int freed = Control.PreferredSize.
Width
- MaximumSize.
Width
;
212
if (MaximumSize.
Width
+ growBy < Control.PreferredSize.
Width
)
274
preferredSize.Width = constrainingSize.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (4)
464
if (cachedBounds.Width > minSize.
Width
)
466
spaceToFree -= (cachedBounds.Width - minSize.
Width
);
468
cachedBounds.Width = (spaceToFree < 0) ? minSize.
Width
+ -spaceToFree : minSize.
Width
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (2)
92
return totalSize.
Width
< DisplayRectangle.Width;
438
int controlToDragWidth = (toolStripToDrag.AutoSize) ? toolStripToDrag.PreferredSize.
Width
: toolStripToDrag.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (4)
878
using Bitmap textBmp = new(textSize.
Width
, textSize.Height, PixelFormat.Format32bppPArgb);
1036
Bitmap disabledBitmap = new(size.
Width
, size.Height);
1040
new Rectangle(0, 0, size.
Width
, size.Height),
1041
0, 0, size.
Width
, size.Height,
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (1)
127
preferredSize.Width = (ParentInternal is not null) ? ParentInternal.Width - 2 : preferredSize.
Width
; // Two for border
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
285
return new Size(constrainingSize.
Width
, SeparatorThickness);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (18)
88
currentWidth += itemSize.
Width
+ item.Margin.Horizontal;
90
int overflowWidth = (OverflowRequired) ? OverflowButtonSize.
Width
: 0;
193
_noMansLand.X += ToolStrip.ClientSize.
Width
+ 1;
223
bool needOverflow = toolStrip.CanOverflow && ((OverflowRequired) || (OverflowSpace >= OverflowButtonSize.
Width
));
298
x = lastRight - (itemMargin.Right + itemSize.
Width
);
301
alignedRightItems = (alignedRightItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.
Width
, itemSize.Height)
302
: Rectangle.Union(alignedRightItems, new Rectangle(x, y, itemSize.
Width
, itemSize.Height));
313
lastLeft = x + itemSize.
Width
+ itemMargin.Right;
314
alignedLeftItems = (alignedLeftItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.
Width
, itemSize.Height)
315
: Rectangle.Union(alignedLeftItems, new Rectangle(x, y, itemSize.
Width
, itemSize.Height));
438
alignedRightItems = (alignedRightItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.
Width
, itemSize.Height)
439
: Rectangle.Union(alignedRightItems, new Rectangle(x, y, itemSize.
Width
, itemSize.Height));
446
alignedLeftItems = (alignedLeftItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.
Width
, itemSize.Height)
447
: Rectangle.Union(alignedLeftItems, new Rectangle(x, y, itemSize.
Width
, itemSize.Height));
467
itemSize.Width = Math.Max(toolStripPreferredSize.
Width
- itemMargin.Horizontal - 1, 0);
591
freedSpace += (horizontal) ? itemSize.
Width
+ itemMargin.Horizontal : itemSize.Height + itemMargin.Vertical;
600
spaceNeeded += (horizontal) ? OverflowButtonSize.
Width
: OverflowButtonSize.Height;
604
OverflowSpace += (horizontal) ? itemSize.
Width
+ itemMargin.Horizontal : itemSize.Height + itemMargin.Vertical;
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (2)
786
int maxTickCount = (Orientation == Orientation.Horizontal ? Size.
Width
: Size.Height) / 2;
1146
int size = Orientation == Orientation.Horizontal ? Size.
Width
: Size.Height;
System\Windows\Forms\Controls\TreeView\TreeNode.cs (1)
632
visible = (rc.bottom > 0 && rc.right > 0 && rc.top < size.Height && rc.left < size.
Width
);
System\Windows\Forms\Controls\TreeView\TreeView.cs (4)
1624
PInvokeCore.SendMessage(toolTip, PInvoke.TTM_SETMAXTIPWIDTH, 0, SystemInformation.MaxWindowTrackSize.
Width
);
2830
bounds = new Rectangle(textLoc, new Size(textSize.
Width
, bounds.Height));
3151
Rectangle rect = new(0, 0, Size.
Width
- 1, Size.Height - 1);
3220
PInvokeCore.SendMessage(nmhdr->hwndFrom, PInvoke.TTM_SETMAXTIPWIDTH, 0, SystemInformation.MaxWindowTrackSize.
Width
);
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (2)
516
int width = LayoutUtils.OldGetLargestStringSizeInCollection(Font, Items).
Width
;
519
width = SizeFromClientSizeInternal(new(width, height)).
Width
+ _upDownButtons.Width;
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (5)
813
int textWidth = TextRenderer.MeasureText(GetNumberText(testNumber), Font).
Width
;
821
int shortTextWidth = TextRenderer.MeasureText(shortText, Font).
Width
;
829
int width = SizeFromClientSizeInternal(new(textWidth, height)).
Width
+ _upDownButtons.Width;
852
if (digitSize.
Width
>= digitWidth)
854
digitWidth = digitSize.
Width
;
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (2)
286
set => base.MaximumSize = new Size(value.
Width
, 0);
292
set => base.MinimumSize = new Size(value.
Width
, 0);
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (2)
201
ResizeTo(value.
Width
, value.Height);
392
htmlWindow.Value->resizeTo(size.
Width
, size.Height).ThrowOnFailure();
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (4)
788
extent = SetExtent(extent.
Width
, extent.Height);
791
Bounds = new Rectangle(location.X, location.Y, extent.
Width
, extent.Height);
1112
Point phm = new(sz.
Width
, sz.Height);
1125
PointF pcont = new(sz.
Width
, sz.Height);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.WebBrowserBaseNativeWindow.cs (2)
44
if (s.
Width
== -1)
52
wp->cx = s.
Width
;
System\Windows\Forms\Design\ComponentEditorForm.cs (5)
236
_maxSize.
Width
, _maxSize.Height);
251
int xFrame = SystemInformation.FixedFrameBorderSize.
Width
;
352
if (pageSize.
Width
> _maxSize.
Width
)
354
_maxSize.Width = pageSize.
Width
;
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (4)
219
textSize = Size.Ceiling(g.MeasureString(messageText, Font, textSize.
Width
));
223
if (textSize.
Width
< _scaledMaxTextWidth)
233
int width = textSize.
Width
+ _scaledPaddingWidth;
266
textSize.
Width
, textSize.Height);
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.cs (2)
216
x = _control.Left - size.
Width
- _iconPadding;
241
return new Rectangle(x, y, size.
Width
, size.Height);
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
125
(LPARAM)SystemInformation.MaxWindowTrackSize.
Width
);
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (3)
53
int widthInBytes = 2 * ((size.
Width
+ 15) / bitmapBitsAllocationSize); // its in bytes.
61
for (int x = 0; x < size.
Width
; x++)
72
_region.Intersect(new Rectangle(0, 0, size.
Width
, size.Height));
System\Windows\Forms\Form.cs (42)
1198
if (value.
Width
< 0 || value.Height < 0)
1217
if (minimumSize.
Width
> value.
Width
)
1219
minimumSize.Width = value.
Width
;
1241
if (!value.IsEmpty && (size.
Width
> value.
Width
|| size.Height > value.Height))
1243
Size = new Size(Math.Min(size.
Width
, value.
Width
), Math.Min(size.Height, value.Height));
1311
if (value.
Width
< 0 || value.Height < 0)
1334
if (maximumSize.
Width
< value.
Width
)
1336
maximumSize.Width = value.
Width
;
1358
if (size.
Width
< value.
Width
|| size.Height < value.Height)
1360
Size = new Size(Math.Max(size.
Width
, value.
Width
), Math.Max(size.Height, value.Height));
1372
Size.
Width
,
2993
float percX = AdjustScale(newVar.
Width
/ ((float)baseVar.
Width
));
3053
if (correctClientSize.
Width
!= currentClient.Width)
3070
bounds.Width = correct.
Width
;
3621
cp.Width = correct.
Width
;
3860
p.X = (ownerRect.left + ownerRect.right - s.
Width
) / 2;
3865
else if (p.X + s.
Width
> screenRect.X + screenRect.Width)
3867
p.X = screenRect.X + screenRect.Width - s.
Width
;
4212
form.SetBounds(new Rectangle(Left, Top, adjustedSize.
Width
, adjustedSize.Height), BoundsSpecified.None);
4411
new Rectangle(size.
Width
- SizeGripSize, size.Height - SizeGripSize, SizeGripSize, SizeGripSize));
4418
size.
Width
- SizeGripSize,
4551
desiredSize.Width = (int)(Size.
Width
* autoScaleFactor.Width);
4578
size->cx = desiredSize.
Width
;
5011
_formStateEx[s_formStateExWindowBoundsWidthIsClientSize] == 1 ? restoredSize.
Width
: _restoredWindowBounds.Width,
5233
if (width > max.
Width
)
5235
width = max.
Width
;
5253
if (width < min.
Width
)
5255
width = min.
Width
;
5309
if (x != ClientSize.
Width
|| y != ClientSize.Height)
6780
mmi->ptMinTrackSize.X = minTrack.
Width
;
6801
if (minTrack.
Width
> virtualScreen.
Width
)
6812
mmi->ptMaxTrackSize.X = Math.Max(maxTrack.
Width
, minTrackWindowSize.
Width
);
6910
if (point.X >= (clientSize.
Width
- SizeGripSize) &&
System\Windows\Forms\Input\Cursor.cs (9)
225
return (nint)PInvokeCore.CopyCursor(this, sz.
Width
, sz.Height, IMAGE_FLAGS.LR_DEFAULTCOLOR);
279
imageWidth = cursorSize.
Width
;
292
targetWidth = cursorSize.
Width
;
304
&& imageWidth == cursorSize.
Width
&& imageHeight == cursorSize.Height)
310
drawWidth = cursorSize.
Width
* targetWidth / imageWidth;
319
&& cursorSize.
Width
<= targetWidth && cursorSize.Height <= targetHeight
320
&& cursorSize.
Width
== imageWidth && cursorSize.Height == imageHeight)
326
drawWidth = cursorSize.
Width
;
424
picSize.
Width
,
System\Windows\Forms\Layout\CommonProperties.cs (2)
207
bounds.Width = Math.Min(bounds.Width, value.
Width
);
231
bounds.Width = Math.Max(bounds.Width, value.
Width
);
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
743
retval.Width = (int)Math.Round(size.
Width
/ ((float)FontMeasureString.Length));
System\Windows\Forms\Layout\Containers\SplitContainer.cs (2)
1259
if (DesignMode && Width != DefaultSize.
Width
&& value + Panel2MinSize + SplitterWidth > Width)
1288
if (DesignMode && Width != DefaultSize.
Width
&& value + Panel1MinSize + SplitterWidth > Width)
System\Windows\Forms\Layout\DefaultLayout.cs (22)
58
if (bounds.Width < prefSize.
Width
|| bounds.Height < prefSize.Height)
84
Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || (newSize.Height >= oldBounds.Height && newSize.
Width
>= oldBounds.Width),
90
location.X -= newSize.
Width
- oldBounds.Width;
401
Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.
Width
, elementSize.Height);
414
Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Bottom - elementSize.Height, elementSize.
Width
, elementSize.Height);
427
Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.
Width
, elementSize.Height);
440
Rectangle newElementBounds = new(remainingBounds.Right - elementSize.
Width
, remainingBounds.Y, elementSize.
Width
, elementSize.Height);
458
Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.
Width
, elementSize.Height);
539
Size newSize = xGetDockedSize(element, /* constraints = */ new Size(remainingSize.
Width
, 1));
542
newSize.Width = remainingSize.
Width
;
546
newSize.Width = Math.Max(newSize.
Width
, remainingSize.
Width
);
549
Debug.Assert((measureOnly && (newSize.
Width
>= remainingSize.
Width
)) || (newSize.
Width
== remainingSize.
Width
),
586
Debug.Assert(desiredSize.
Width
>= 0 && desiredSize.Height >= 0, "Error detected in xGetDockSize: Element size was negative.");
1130
prefSize.Width = Math.Max(prefSize.
Width
, elementSpace.Right);
1148
prefSize.Width = Math.Max(prefSize.
Width
, anchorInfo is null ? bounds.Right : bounds.Right + anchorInfo.Right);
1154
? Math.Max(prefSize.
Width
, elementSpace.Right + anchorDest.Width)
1155
: Math.Max(prefSize.
Width
, anchorDest.Right);
System\Windows\Forms\Layout\FlowLayout.cs (9)
28
if (prefSize.
Width
> proposedConstraints.
Width
|| prefSize.Height > proposedConstraints.Height)
88
rowSize.
Width
,
93
layoutSize.Width = Math.Max(layoutSize.
Width
, rowSize.
Width
);
192
elementConstraints.Width = rowBounds.Width - rowSize.
Width
- elementProxy.Margin.Size.
Width
;
226
Rectangle cellBounds = new(location, new Size(requiredSize.
Width
, rowBounds.Height));
237
location.X += requiredSize.
Width
;
System\Windows\Forms\Layout\LayoutUtils.cs (32)
51
largestSize.Width = Math.Max(largestSize.
Width
, textSize.
Width
);
126
if (size.
Width
== 0)
208
Math.Max(a.
Width
, b.
Width
),
215
Math.Min(a.
Width
, b.
Width
),
294
withinThis.X += withinThis.Width - alignThis.
Width
;
298
withinThis.X += (withinThis.Width - alignThis.
Width
) / 2;
301
withinThis.Width = alignThis.
Width
;
310
withinThis.X += withinThis.Width - alignThis.
Width
;
314
withinThis.X += (withinThis.Width - alignThis.
Width
) / 2;
317
withinThis.Width = alignThis.
Width
;
357
(anchorStyles & HorizontalAnchorStyles) == HorizontalAnchorStyles ? withinThis.
Width
: stretchThis.
Width
,
359
if (stretchedSize.
Width
> withinThis.
Width
)
361
stretchedSize.Width = withinThis.
Width
;
399
currentSize.Width = Math.Max(currentSize.
Width
, contentSize.
Width
);
404
currentSize.Width += contentSize.
Width
;
456
(size.Height, size.Width) = (size.
Width
, size.Height);
495
return (size.
Width
== 0 || size.Height == 0);
500
return ((size1.
Width
>= size2.
Width
) && (size1.Height >= size2.Height));
509
region1.Width = specifiedContent.
Width
;
510
region2.X += specifiedContent.
Width
;
511
region2.Width -= specifiedContent.
Width
;
514
region1.X += bounds.Width - specifiedContent.
Width
;
515
region1.Width = specifiedContent.
Width
;
516
region2.Width -= specifiedContent.
Width
;
583
currentSize.Width -= contentSize.
Width
;
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (4)
62
else if ((sizeCache.ConstrainingSize.
Width
== proposedConstraints.
Width
)
103
return GetUnconstrainedSize(text, font, flags).
Width
> size.
Width
;
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (1)
374
if (proposedConstraints.Height == 0 || proposedConstraints.
Width
== 0)
System\Windows\Forms\Layout\TableLayout.cs (19)
108
containerSize.Width = Math.Max(containerSize.
Width
, 1);
165
containerSize.Width = Math.Max(containerSize.
Width
, 1);
168
containerInfo.ColumnStyles[0].SetSize(Math.Max(oldWidth, Math.Min(proposedConstraints.
Width
, containerSize.
Width
)));
178
proposedConstraints.Width = Math.Max(proposedConstraints.
Width
, 1);
226
if (cols.Length != 0 && totalSpace.
Width
> usedSpace.
Width
)
228
cols[^1].MinSize += totalSpace.
Width
- usedSpace.
Width
;
646
int expandLastElementWidth = Math.Max(0, proposedConstraints.
Width
- preferredSize.
Width
);
693
if (dontHonorConstraint && (proposedConstraints.
Width
< short.MaxValue))
726
minWidth = GetElementSize(element, new Size(0, constrainingHeight)).
Width
;
731
minWidth = GetElementSize(element, new Size(1, 0)).
Width
;
732
maxWidth = GetElementSize(element, Size.Empty).
Width
;
746
int width = DistributeStyles(containerInfo.CellBorderWidth, containerInfo.ColumnStyles, containerInfo.Columns, proposedConstraints.
Width
, dontHonorConstraint);
749
if (dontHonorConstraint && width > proposedConstraints.
Width
&& proposedConstraints.
Width
> 1)
778
int currentOverflow = width - proposedConstraints.
Width
;
System\Windows\Forms\OLE\DataObject.Composition.WinFormsToNativeAdapter.cs (2)
174
HBITMAP compatibleBitmap = PInvokeCore.CreateCompatibleBitmap(screenDC, bitmap.Size.
Width
, bitmap.Size.Height);
182
bitmap.Size.
Width
,
System\Windows\Forms\Printing\PrintPreviewControl.cs (19)
422
internal double HorizontalViewSize => InsideRectangle.Width * 100.0 / VirtualSize.
Width
;
486
double zoomX = ((double)controlPhysicalSize.
Width
- Border * (_columns + 1)) / (_columns * pageSize.
Width
);
491
_imageSize = new Size((int)(_zoom * pageSize.
Width
), (int)(_zoom * pageSize.Height));
492
int virtualX = (_imageSize.
Width
* _columns) + Border * (_columns + 1);
626
Math.Max(0, (rect.Width - _virtualSize.
Width
) / 2),
654
double zoomX = ((double)controlPhysicalSize.
Width
- Border * (_columns + 1))
655
/ (_columns * pageSize.
Width
);
661
_imageSize = new Size((int)(_zoom * pageSize.
Width
), (int)(_zoom * pageSize.Height));
667
lastImageSize.X += imagePixels.
Width
;
672
pageRenderArea[imageIndex - StartPage] = new Rectangle(x, y, imagePixels.
Width
, imagePixels.Height);
752
new(PixelsToPhysical(pixels.
Width
, dpi.X), PixelsToPhysical(pixels.Height, dpi.Y));
758
new(PhysicalToPixels(physical.
Width
, dpi.X), PhysicalToPixels(physical.Height, dpi.Y));
806
virtualDimension: _virtualSize.
Width
,
854
bool horizontal = _virtualSize.
Width
> displaySize.
Width
&& displaySize.
Width
> _vScrollBar.Width;
859
horizontal = _virtualSize.
Width
> (displaySize.
Width
- _vScrollBar.Width);
System\Windows\Forms\Rendering\ControlPaint.cs (17)
100
float xRatio = bounds.Width / (float)imageSize.
Width
;
122
result.Width = (int)((imageSize.
Width
* yRatio) + .5);
226
graphics.FillRectangle(brush, 0, 0, size.
Width
, size.Height);
227
graphics.DrawImage(bitmap, 0, 0, size.
Width
, size.Height);
295
return (IntPtr)PInvokeCore.CreateBitmap(size.
Width
, size.Height, nPlanes: 1, nBitCount: 1, pBits);
323
PInvokeCore.BitBlt(targetDC, x: 0, y: 0, size.
Width
, size.Height, sourceDC, x1: 0, y1: 0, (ROP_CODE)0x220326);
1038
rc.left -= sz.
Width
;
1039
rc.right += sz.
Width
;
1513
if (pixelsBetweenDots.
Width
<= 0 || pixelsBetweenDots.Height <= 0)
1519
if (t_gridBrush is null || s_gridSize.
Width
!= pixelsBetweenDots.
Width
1534
int width = ((idealSize / pixelsBetweenDots.
Width
) + 1) * pixelsBetweenDots.
Width
;
1540
for (int x = 0; x < width; x += pixelsBetweenDots.
Width
)
1641
new Rectangle(0, 0, imageSize.
Width
, imageSize.Height),
1642
0, 0, imageSize.
Width
, imageSize.Height,
1654
0, 0, imageSize.
Width
, imageSize.Height,
System\Windows\Forms\Rendering\TextExtensions.cs (2)
234
if (proposedSize.
Width
<= minWidth)
258
if (proposedSize.
Width
== int.MaxValue)
System\Windows\Forms\Scrolling\ScrollableControl.cs (12)
103
if (value.
Width
< 0 || value.Height < 0)
108
SetAutoScrollMargin(value.
Width
, value.Height);
221
if (AutoScrollMinSize.
Width
!= 0 && AutoScrollMinSize.Height != 0)
223
displayRectangle.Width = Math.Max(displayRectangle.Width, AutoScrollMinSize.
Width
);
368
_scrollMargin.Width += current.Size.
Width
;
377
maxX = _userAutoScrollMinSize.
Width
+ _scrollMargin.
Width
;
388
if (layoutBounds.
Width
> maxX)
391
maxX = layoutBounds.
Width
;
461
int ctlRight = -display.X + bounds.X + bounds.Width + _scrollMargin.
Width
;
857
int xMargin = _scrollMargin.
Width
;
963
if (x != _requestedScrollMargin.
Width
|| y != _requestedScrollMargin.Height)
System\Windows\Forms\SystemInformation.cs (1)
462
return new Rectangle(0, 0, size.
Width
, size.Height);
System\Windows\Forms\ToolTip\ToolTip.cs (8)
732
PInvokeCore.SendMessage(this, PInvoke.TTM_SETMAXTIPWIDTH, 0, SystemInformation.MaxWindowTrackSize.
Width
);
1495
Point optimalPoint = GetOptimalToolTipPosition(tool, toolRectangle, bubbleSize.
Width
, bubbleSize.Height);
1933
if (moveToLocation.X + tipSize.
Width
> screen.WorkingArea.Right)
1935
moveToLocation.X = screen.WorkingArea.Right - tipSize.
Width
;
1954
tipSize.
Width
,
2088
? Math.Min(currentTooltipSize.
Width
- 2 * BalloonOffsetX, screen.WorkingArea.Width)
2089
: Math.Min(currentTooltipSize.
Width
, screen.WorkingArea.Width);
2112
currentTooltipSize.
Width
,
System.Windows.Forms.Design (157)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (5)
190
_listBox.ItemHeight = Font.Height + SystemInformation.BorderSize.
Width
* 2;
218
w += SystemInformation.BorderSize.
Width
* 4;
227
return (int)Math.Ceiling(size.Width) + w + pic + SystemInformation.BorderSize.
Width
* 4;
570
w += SystemInformation.BorderSize.
Width
* 4;
575
button.Inflate(-SystemInformation.BorderSize.
Width
* 2, -SystemInformation.BorderSize.Height * 2);
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (2)
62
if (_showSplit && !string.IsNullOrEmpty(Text) && TextRenderer.MeasureText(Text, Font).
Width
+ PushButtonWidth > preferredSize.
Width
)
System\ComponentModel\Design\DesignerActionPanel.cs (7)
242
if (rectangleAnchor.Right + sizePanel.
Width
> rectScreen.Right)
245
if (rectangleAnchor.Left - sizePanel.
Width
< rectScreen.Left)
324
x = rectangleAnchor.Left - sizePanel.
Width
- EDGE_SPACE;
330
x = rectangleAnchor.Left - sizePanel.
Width
- EDGE_SPACE;
336
x = rectangleAnchor.Right - sizePanel.
Width
;
380
Size size = line.LayoutControls(yPos, proposedSize.
Width
, measureOnly);
381
panelWidth = Math.Max(panelWidth, size.
Width
);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (9)
95
maxWidth = Math.Max(textSize.
Width
, maxWidth);
106
listBox.Width = Math.Max(maxWidth, EditRegionSize.
Width
);
177
_button.Location = new Point(EditRegionLocation.X + EditRegionSize.
Width
- buttonHeight - EditorLineButtonPadding, EditRegionLocation.Y + EditorLineButtonPadding + 1);
338
hostedControl.Width = Math.Max(hostedControl.Width, EditRegionSize.
Width
- 2);
348
dropDownSize.Width = Math.Max(editorBounds.Width + 1, dropDownSize.
Width
);
350
editorLocation.X = Math.Min(rectScreen.Right - dropDownSize.
Width
, // min = right screen edge clip
351
Math.Max(rectScreen.X, editorLocation.X + editorBounds.Right - dropDownSize.
Width
)); // max = left screen edge clip
372
dropDownSize.Width = Math.Max(editorBounds.Width + 1, dropDownSize.
Width
);
374
editorLocation.X = Math.Min(rectScreen.Right - dropDownSize.
Width
, // min = right screen edge clip
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
36
int width = Math.Max(_hostedControl.Width, SystemInformation.MinimumWindowSize.
Width
);
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (2)
72
int newWidth = Math.Max(titleSize.
Width
, subtitleSize.
Width
) + 2 * PanelHeaderHorizontalPadding;
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (3)
83
return LineLeftMargin + _label.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)).
Width
+ TextBoxLineCenterMargin;
110
int labelPreferredWidth = _label.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)).
Width
;
115
EditControl.Width = _editRegionSize.
Width
- GetTextBoxRightPadding(textBoxPreferredHeight) - GetTextBoxLeftPadding(textBoxPreferredHeight) - specialPadding;
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (2)
169
if (Size.
Width
!= ctrl.Size.
Width
|| Size.Height != ctrl.Size.Height)
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (9)
161
requestedSize.Width = Math.Max(requestedSize.
Width
, MinimumSize.
Width
);
172
int requestedDelta = Math.Min((requestedSize.
Width
- ClientSize.
Width
), maxDelta);
173
ClientSize = new Size(ClientSize.
Width
+ requestedDelta, MinimumSize.Height);
241
(int)Math.Min(Math.Ceiling(WatermarkSize.
Width
* 1.75), workingArea.Width / 3),
383
return WatermarkSize.
Width
< ClientSize.
Width
;
417
new RectangleF(0.0f, 0.0f, ClientSize.
Width
, ClientSize.Height),
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
89
Size = new Size(size.
Width
+ 2 * CMARGIN, size.Height + 2 * CMARGIN + rectItemSize.Height);
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (1)
72
int XBORDER = SystemInformation.Border3DSize.
Width
;
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (2)
178
if (delta.
Width
>= DesignerUtils.MinDragSize.
Width
/ 2 || delta.Height >= DesignerUtils.MinDragSize.Height / 2)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (3)
146
int xDelta = controlLocation.X % _parentGridSize.
Width
;
149
if (xDelta > _parentGridSize.
Width
/ 2)
151
offset.X = _parentGridSize.
Width
- xDelta;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (10)
96
int xDelta = controlBounds.Right % _parentGridSize.
Width
;
97
if (xDelta > _parentGridSize.
Width
/ 2)
99
rect.Width += _parentGridSize.
Width
- xDelta;
108
int xDelta = controlBounds.Left % _parentGridSize.
Width
;
109
if (xDelta > _parentGridSize.
Width
/ 2)
111
rect.X += _parentGridSize.
Width
- xDelta;
112
rect.Width -= _parentGridSize.
Width
- xDelta;
149
rect.Width = Math.Max(rect.Width, _parentGridSize.
Width
);
492
if (Math.Abs(_initialPoint.X - mouseLoc.X) > DesignerUtils.MinDragSize.
Width
/ 2 || Math.Abs(_initialPoint.Y - mouseLoc.Y) > DesignerUtils.MinDragSize.Height / 2)
550
int minWidth = Math.Max(targetControl.MinimumSize.
Width
, MINSIZE);
System\Windows\Forms\Design\CommandSet.cs (31)
854
moveOffsetX *= snapSize.
Width
;
1059
loc.X = primaryLocation.X + primarySize.
Width
- size.
Width
;
1067
loc.X = primarySize.
Width
/ 2 + primaryLocation.X - size.
Width
/ 2;
1188
delta = loc.X % gridSize.
Width
;
1189
if (delta < (gridSize.
Width
/ 2))
1195
loc.X += (gridSize.
Width
- delta);
1306
if (loc.X + size.
Width
> right)
1307
right = loc.X + size.
Width
;
1323
int centerOfParentX = (viewParent.ClientSize.
Width
) / 2;
2354
itemSize.Width = primarySize.
Width
;
2430
size.Width = ((size.
Width
+ (grid.
Width
/ 2)) / grid.
Width
) * grid.
Width
;
2432
loc.X = (loc.X / grid.
Width
) * grid.
Width
;
2613
total += curSize.
Width
;
2702
? (lastSize.
Width
+ lastLoc.X - curLoc.X - total) / (selectedObjects.Length - 1)
2799
curLoc.X = lastLoc.X + lastSize.
Width
;
2805
curLoc.X -= grid.
Width
* (n - primaryIndex);
2811
curLoc.X += grid.
Width
* (primaryIndex - n);
2820
curLoc.X += grid.
Width
* (n - primaryIndex);
2824
curLoc.X -= grid.
Width
* (primaryIndex - n);
2829
curLoc.X = lastLoc.X + lastSize.
Width
+ nEqualDelta;
3261
if (max.X < loc.X + size.
Width
)
3263
max.X = loc.X + size.
Width
;
3291
Point parentOffset = new(parentSize.
Width
/ 2, parentSize.Height / 2);
3379
groupEndX = parentOffset.X + gridSize.
Width
;
3383
if (groupEndX > parentSize.
Width
|| groupEndY > parentSize.Height)
System\Windows\Forms\Design\ComponentTray.cs (10)
1863
if (newLoc.X + c.Size.
Width
> Size.
Width
)
1924
_borderWidth = SystemInformation.BorderSize.
Width
;
1996
rc.Width = Math.Max(_cxIcon, sz.
Width
) + 4 * _borderWidth + 2 * WhiteSpace;
2001
rc.Width = _cxIcon + sz.
Width
+ 4 * _borderWidth + 2 * WhiteSpace;
2191
minDrag.Width = Math.Max(minDrag.
Width
, minDblClick.
Width
);
2196
(Math.Abs(_mouseDragLast.X - newPt.X) < minDrag.
Width
&&
2422
if (Math.Abs(bounds.X - x) > parentGridSize.
Width
|| Math.Abs(bounds.Y - y) > parentGridSize.Height)
2457
_cxIcon = sz.
Width
;
System\Windows\Forms\Design\ControlCommandSet.cs (2)
645
if ((primaryControlsize.
Width
<= 0) || (primaryControlsize.Height <= 0))
698
moveOffsetX *= snapSize.
Width
;
System\Windows\Forms\Design\ControlDesigner.cs (6)
1380
minDrag.Width = Math.Max(minDrag.
Width
, minDblClick.
Width
);
1385
(Math.Abs(_mouseDragLast.X - x) < minDrag.
Width
&&
2251
Rectangle imageRect = new(marginX, marginY, glyphSize.
Width
, glyphSize.Height);
2338
if (x >= _lastClickMessagePositionX - dblClick.
Width
2339
&& x <= _lastClickMessagePositionX + dblClick.
Width
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (2)
1004
int textWidth = Size.Ceiling(e.Graphics.MeasureString(columnName, e.Font!, new SizeF(bounds.Width, bounds.Height))).
Width
;
1160
int itemWidth = TextRenderer.MeasureText(_selectedColumns.Items[i].ToString(), _selectedColumns.Font).
Width
;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (1)
50
width = Math.Max(width, Size.Ceiling(g.MeasureString(item.ToString(), _typesListBox.Font)).
Width
);
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
456
ScaleHelper.ScaleToPercent(_initialSize.
Width
, scalePercent),
System\Windows\Forms\Design\DesignerFrame.cs (1)
166
_designer!.Location = new Point(selectionSize.
Width
, selectionSize.Height);
System\Windows\Forms\Design\DesignerOptions.cs (2)
30
if (value.
Width
< MinGridSize)
40
if (value.
Width
> MaxGridSize)
System\Windows\Forms\Design\DesignerUtils.cs (7)
146
s_minDragSize.Width = Math.Max(minDrag.
Width
, minDblClick.
Width
);
197
g.DrawLine(pen, 1, 0, imageSize.
Width
- 2, 0);
198
g.DrawLine(pen, 1, imageSize.Height - 1, imageSize.
Width
- 2, imageSize.Height - 1);
200
g.DrawLine(pen, imageSize.
Width
- 1, 1, imageSize.
Width
- 1, imageSize.Height - 2);
205
g.DrawRectangle(pen, i, i, imageSize.
Width
- (2 + i), imageSize.Height - (2 + i));
System\Windows\Forms\Design\FormDocumentDesigner.cs (2)
277
float percX = newVar.
Width
/ ((float)baseVar.Width);
427
int clientWidth = form.ClientSize.
Width
;
System\Windows\Forms\Design\InheritanceUI.cs (1)
37
s_inheritanceGlyphRect = new Rectangle(0, 0, size.
Width
, size.Height);
System\Windows\Forms\Design\ParentControlDesigner.cs (19)
253
if (value.
Width
< MinGridSize || value.Height < MinGridSize ||
254
value.
Width
> MaxGridSize || value.Height > MaxGridSize)
424
loc.Offset(GridSize.
Width
, GridSize.Height);
496
bounds.X = selectedControl.Location.X + GridSize.
Width
;
506
bounds.Width = size.
Width
;
533
bounds.X += offset.
Width
;
920
int parentWidth = parent.ClientSize.
Width
;
969
if (size.
Width
<= 0 || size.Height <= 0)
1139
Point halfGrid = new(gridSize.
Width
/ 2, gridSize.Height / 2);
1148
updatedRect.X = (dragRect.X / gridSize.
Width
) * gridSize.
Width
;
1153
updatedRect.X += gridSize.
Width
;
1172
updatedRect.Width = ((dragRect.X + dragRect.Width) / gridSize.
Width
) * gridSize.
Width
- updatedRect.X;
1177
if (updatedRect.Width < gridSize.
Width
)
1178
updatedRect.Width = gridSize.
Width
;
1861
Size minControlSize = new(DesignerUtils.MinDragSize.
Width
* 2, DesignerUtils.MinDragSize.Height * 2);
1862
if (offset.Width < minControlSize.
Width
)
1864
offset.Width = minControlSize.
Width
;
System\Windows\Forms\Design\SelectionUIHandler.cs (6)
72
containerRect.Inflate(snapSize.
Width
, snapSize.Height);
320
if (targetWidth < minSize.
Width
)
322
targetWidth = minSize.
Width
;
489
if (widthProp is not null && !widthProp.IsReadOnly && size.
Width
!= (int)widthProp.GetValue(components[i])!)
498
controls[i].Width = size.
Width
;
649
Width = sz.
Width
;
System\Windows\Forms\Design\SelectionUIService.cs (1)
631
Math.Abs(screenCoord.X - _mouseDragAnchor.X) < minDragSize.
Width
&&
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (3)
232
Size = new Size(Size.
Width
+ _resetButton.Size.
Width
- resetButtonSize.
Width
, Size.Height);
System\Windows\Forms\Design\TabOrder.cs (2)
52
_selSize = DesignerUtils.GetAdornmentDimensions(AdornmentType.GrabHandle).
Width
;
257
convertedRectangle.Width = sz.
Width
+ 2;
System\Windows\Forms\Design\ToolStripEditorManager.cs (1)
142
private void UpdateSize() => Size = new Size(_wrappedEditor.Size.
Width
, _wrappedEditor.Size.Height);
System\Windows\Forms\Design\ToolStripItemBehavior.cs (2)
991
parentDesigner.DragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.X - (dragSize.
Width
/ 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize);
1014
ownerItemDesigner._dragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.X - (dragSize.
Width
/ 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize);
System.Windows.Forms.Primitives (8)
System\Windows\Forms\Internals\ScaleHelper.cs (8)
164
if (desiredSize.
Width
% originalSize.
Width
== 0 && desiredSize.Height % originalSize.Height == 0)
171
else if (desiredSize.
Width
< originalSize.
Width
&& desiredSize.Height < originalSize.Height)
177
Bitmap scaledBitmap = new(desiredSize.
Width
, desiredSize.Height, bitmap.PixelFormat);
184
RectangleF sourceBounds = new(0, 0, bitmap.Size.
Width
, bitmap.Size.Height);
185
RectangleF destinationBounds = new(0, 0, desiredSize.
Width
, desiredSize.Height);
303
: new(ScaleToDpi(logicalSize.
Width
, dpi), ScaleToDpi(logicalSize.Height, dpi));
System.Windows.Forms.Primitives.Tests (3)
Interop\Ole32\IPictureTests.cs (3)
29
Assert.Equal(arrow.Size.
Width
, GdiHelper.HimetricToPixelX(width));
46
Assert.Equal(bitmap.Size.
Width
, GdiHelper.HimetricToPixelX(width));
66
Assert.Equal(bitmap.Size.
Width
, GdiHelper.HimetricToPixelX((int)variant.data.uintVal));
System.Windows.Forms.Tests (166)
DpiHelperTests.cs (1)
25
(int)Math.Round(value.
Width
* (ScaleHelper.InitialSystemDpi / (double)ScaleHelper.OneHundredPercentLogicalDpi)),
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (1)
151
int expectedWidth = dataGridView.Size.
Width
;
System\Windows\Forms\CheckBoxTests.cs (1)
97
Assert.True(control.PreferredSize.
Width
> 0);
System\Windows\Forms\ControlTests.Methods.cs (19)
9781
control.SetClientSizeCore(value.
Width
, value.Height);
9791
control.SetClientSizeCore(value.
Width
, value.Height);
9815
control.SetClientSizeCore(value.
Width
, value.Height);
9821
Assert.Equal(expectedSize.
Width
, control.Right);
9824
Assert.Equal(expectedSize.
Width
, control.Width);
9831
control.SetClientSizeCore(value.
Width
, value.Height);
9837
Assert.Equal(expectedSize.
Width
, control.Right);
9840
Assert.Equal(expectedSize.
Width
, control.Width);
9863
control.SetClientSizeCore(value.
Width
, value.Height);
9869
Assert.Equal(expectedSize.
Width
, control.Right);
9872
Assert.Equal(expectedSize.
Width
, control.Width);
9882
control.SetClientSizeCore(value.
Width
, value.Height);
9888
Assert.Equal(expectedSize.
Width
, control.Right);
9891
Assert.Equal(expectedSize.
Width
, control.Width);
10119
Size expected = new(clientSize.
Width
+ 4, clientSize.Height + 4);
10398
Assert.True(control.ClientSize.
Width
> 0);
10408
Assert.True(control.Size.
Width
> 0);
10431
Assert.True(control.ClientSize.
Width
> 0);
10441
Assert.True(control.Size.
Width
> 0);
System\Windows\Forms\ControlTests.Properties.cs (34)
3386
Assert.Equal(expectedSize.
Width
, control.Right);
3389
Assert.Equal(expectedSize.
Width
, control.Width);
3402
Assert.Equal(expectedSize.
Width
, control.Right);
3405
Assert.Equal(expectedSize.
Width
, control.Width);
3449
Assert.Equal(expectedSize.
Width
, control.Right);
3452
Assert.Equal(expectedSize.
Width
, control.Width);
3468
Assert.Equal(expectedSize.
Width
, control.Right);
3471
Assert.Equal(expectedSize.
Width
, control.Width);
11113
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.ClientRectangle);
11114
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.DisplayRectangle);
11117
Assert.Equal(value.
Width
, control.Right);
11120
Assert.Equal(value.
Width
, control.Width);
11122
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
11132
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.ClientRectangle);
11133
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.DisplayRectangle);
11136
Assert.Equal(value.
Width
, control.Right);
11139
Assert.Equal(value.
Width
, control.Width);
11141
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
11323
Assert.Equal(value.
Width
, control.Right);
11326
Assert.Equal(value.
Width
, control.Width);
11328
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
11342
Assert.Equal(value.
Width
, control.Right);
11345
Assert.Equal(value.
Width
, control.Width);
11347
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
11434
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.ClientRectangle);
11435
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.DisplayRectangle);
11438
Assert.Equal(value.
Width
, control.Right);
11441
Assert.Equal(value.
Width
, control.Width);
11443
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
11454
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.ClientRectangle);
11455
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.DisplayRectangle);
11458
Assert.Equal(value.
Width
, control.Right);
11461
Assert.Equal(value.
Width
, control.Width);
11463
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
System\Windows\Forms\CursorsTests.cs (1)
54
Assert.True(hotSpot.X >= 0 && hotSpot.X <= cursor.Size.
Width
);
System\Windows\Forms\CursorTests.cs (4)
232
Assert.True(hotSpot.X >= 0 && hotSpot.X <= cursor.Size.
Width
);
368
yield return new object[] { new Rectangle(0, 0, Cursors.Default.Size.
Width
, Cursors.Default.Size.Height) };
369
yield return new object[] { new Rectangle(1, 0, Cursors.Default.Size.
Width
, Cursors.Default.Size.Height) };
371
yield return new object[] { new Rectangle(0, 0, Cursors.Default.Size.
Width
, 4) };
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
98
Assert.Equal(4, control.PreferredSize.
Width
);
System\Windows\Forms\Design\ComponentEditorFormTests.cs (5)
31
Assert.True(control.AutoScaleBaseSize.
Width
> 0);
56
Assert.Equal(new Rectangle(0, 0, control.ClientSize.
Width
, control.ClientSize.Height), control.ClientRectangle);
57
Assert.Equal(new Size(control.ClientSize.
Width
, control.ClientSize.Height), control.ClientSize);
79
Assert.Equal(new Rectangle(0, 0, control.ClientSize.
Width
, control.ClientSize.Height), control.DisplayRectangle);
130
Assert.True(control.PreferredSize.
Width
> 0);
System\Windows\Forms\FormTests.cs (4)
29
Assert.True(control.AutoScaleBaseSize.
Width
> 0);
54
Assert.Equal(new Rectangle(0, 0, control.ClientSize.
Width
, control.ClientSize.Height), control.ClientRectangle);
55
Assert.True(control.ClientSize.
Width
> 0);
132
Assert.True(control.PreferredSize.
Width
> 0);
System\Windows\Forms\HScrollBarTests.cs (4)
43
Assert.True(control.ClientSize.
Width
> 0);
58
Assert.True(control.DefaultSize.
Width
> 0);
92
Assert.True(control.PreferredSize.
Width
> 0);
104
Assert.True(control.Size.
Width
> 0);
System\Windows\Forms\LabelTests.cs (1)
88
Assert.Equal(0, control.PreferredSize.
Width
);
System\Windows\Forms\ListBoxTests.cs (2)
4848
Assert.True(result.
Width
is > 0 and < 120);
4881
Assert.True(result.
Width
is > 0 and < 120);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (2)
184
? TextRenderer.MeasureText(listViewItem.Text, listViewItem.Font).
Width
200
? TextRenderer.MeasureText(listViewSubItem.Text, listViewSubItem.Font).
Width
System\Windows\Forms\MdiClientTests.cs (6)
542
Assert.Equal(value.
Width
, control.Right);
545
Assert.Equal(value.
Width
, control.Width);
547
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
561
Assert.Equal(value.
Width
, control.Right);
564
Assert.Equal(value.
Width
, control.Width);
566
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
System\Windows\Forms\MenuStripTests.cs (1)
118
Assert.True(control.PreferredSize.
Width
> 0);
System\Windows\Forms\MonthCalendarTests.cs (9)
48
Assert.True(control.ClientSize.
Width
> 0);
67
Assert.True(control.DefaultSize.
Width
> 0);
104
Assert.True(control.PreferredSize.
Width
> 0);
126
Assert.True(control.Size.
Width
> 0);
647
Assert.True(calendar.CalendarDimensions.
Width
is > 0 and <= 12);
654
Assert.True(calendar.CalendarDimensions.
Width
is > 0 and <= 12);
705
Assert.True(calendar.CalendarDimensions.
Width
is > 0 and <= 12);
715
Assert.True(calendar.CalendarDimensions.
Width
is > 0 and <= 12);
2433
Assert.True(size.
Width
>= 169);
System\Windows\Forms\RichTextBoxTests.cs (1)
105
Assert.True(control.PreferredSize.
Width
> 0);
System\Windows\Forms\SplitterPanelTests.cs (10)
829
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.ClientRectangle);
830
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.DisplayRectangle);
833
Assert.Equal(value.
Width
, control.Right);
836
Assert.Equal(value.
Width
, control.Width);
838
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
848
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.ClientRectangle);
849
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.DisplayRectangle);
852
Assert.Equal(value.
Width
, control.Right);
855
Assert.Equal(value.
Width
, control.Width);
857
Assert.Equal(new Rectangle(0, 0, value.
Width
, value.Height), control.Bounds);
System\Windows\Forms\StatusStripTests.cs (1)
117
Assert.True(control.PreferredSize.
Width
> 0);
System\Windows\Forms\SystemInformationTests.cs (24)
49
Assert.True(size.
Width
>= 0);
66
Assert.True(size.
Width
>= 0);
75
Assert.True(size.
Width
>= 0);
137
Assert.True(size.
Width
>= 0);
160
Assert.True(size.
Width
>= 0);
169
Assert.True(size.
Width
>= 0);
194
Assert.True(size.
Width
>= 0);
258
Assert.True(size.
Width
>= 32);
267
Assert.True(size.
Width
>= 0);
404
Assert.True(size.
Width
>= 0);
419
Assert.True(size.
Width
>= 0);
428
Assert.True(size.
Width
>= 0);
437
Assert.True(size.
Width
>= 0);
476
Assert.True(size.
Width
>= 0);
485
Assert.True(size.
Width
>= 0);
494
Assert.True(size.
Width
> 0);
503
Assert.True(size.
Width
> 0);
541
Assert.True(size.
Width
>= 0);
628
Assert.True(size.
Width
> 0);
637
Assert.True(size.
Width
> 0);
680
Assert.True(size.
Width
> 0);
689
Assert.True(size.
Width
> 0);
704
Assert.True(size.
Width
> 0);
821
Assert.True(size.
Width
>= 0);
System\Windows\Forms\TabControlTests.cs (3)
1446
Assert.Equal(0, size.
Width
);
1462
Assert.True(size.
Width
> 0);
1545
Assert.Equal(0, size.
Width
);
System\Windows\Forms\TextRendererTests.cs (6)
405
Assert.True(result.
Width
> 0);
429
Assert.True(result.
Width
> 0);
461
Assert.True(result.
Width
> 0);
476
Assert.True(result.
Width
> 0);
491
Assert.True(result.
Width
> 0);
506
Assert.True(result.
Width
> 0);
System\Windows\Forms\ToolStripComboBoxTests.cs (3)
388
preferredSize.
Width
.Should().BeGreaterThanOrEqualTo(75);
399
preferredSize.
Width
.Should().BeGreaterThanOrEqualTo(basePreferredSize.
Width
);
System\Windows\Forms\ToolStripControlHostTests.cs (2)
2214
Assert.Equal(new Rectangle(1, 2, value.
Width
, value.Height), c.Bounds);
2220
Assert.Equal(new Rectangle(1, 2, value.
Width
, value.Height), c.Bounds);
System\Windows\Forms\ToolStripDropDownTests.cs (2)
126
Assert.True(control.PreferredSize.
Width
> 0);
5006
expectedLocation.Offset(nonClientSize.
Width
- 3, nonClientSize.Height - 1);
System\Windows\Forms\ToolStripTests.cs (2)
134
Assert.True(control.PreferredSize.
Width
> 0);
289
Assert.True(control.PreferredSize.
Width
> 0);
System\Windows\Forms\TreeViewTests.cs (1)
39
Assert.Equal(117, control.ClientSize.
Width
);
System\Windows\Forms\UpDownBaseTests.cs (4)
1113
Assert.Equal(new Size(value.
Width
, 0), control.MaximumSize);
1120
Assert.Equal(new Size(value.
Width
, 0), control.MaximumSize);
1157
Assert.Equal(new Size(value.
Width
, 0), control.MinimumSize);
1164
Assert.Equal(new Size(value.
Width
, 0), control.MinimumSize);
System\Windows\Forms\VScrollBarTests.cs (4)
42
Assert.True(control.ClientSize.
Width
> 0);
57
Assert.True(control.DefaultSize.
Width
> 0);
91
Assert.True(control.PreferredSize.
Width
> 0);
103
Assert.True(control.Size.
Width
> 0);
Text\FontMetrics.cs (1)
68
Assert.Equal(width, extent.
Width
);
TextBoxBaseTests.cs (5)
5085
int width = TextRenderer.MeasureText(control.Text, control.Font).
Width
;
5105
int width = TextRenderer.MeasureText(control.Text, control.Font).
Width
;
5108
Assert.Equal(width + expectedAdditionalWidth, result.
Width
);
5114
Assert.Equal(width + expectedAdditionalWidth, result.
Width
);
5128
int width = TextRenderer.MeasureText(control.Text, control.Font, Size.Empty, TextFormatFlags.SingleLine).
Width
;
TextBoxTests.cs (1)
92
Assert.Equal(4, control.PreferredSize.
Width
);
System.Windows.Forms.UI.IntegrationTests (12)
ButtonTests.cs (7)
130
Assert.True(form.DisplayRectangle.Width > originalFormSize.
Width
);
155
Assert.Equal(originalFormSize.
Width
, form.DisplayRectangle.Width);
180
Assert.True(form.DisplayRectangle.Width > originalFormSize.
Width
);
186
Assert.Equal(originalFormSize.
Width
- originalButtonPosition.Right, form.DisplayRectangle.Width - button.DisplayRectangle.Right);
211
Assert.Equal(originalFormSize.
Width
, form.DisplayRectangle.Width);
261
int horizontalResolution = primaryMonitor.
Width
;
297
int horizontalResolution = primaryMonitor.
Width
;
DragDropTests.cs (1)
721
new Point(e.X - (dragSize.
Width
/ 2),
Infra\ControlTestBase.cs (2)
185
(int)Math.Ceiling((65535.0 / (primaryMonitor.
Width
- 1)) * point.X),
194
TestOutputHelper.WriteLine($"Screen resolution of ({primaryMonitor.
Width
}, {primaryMonitor.Height}) translates mouse to ({virtualPoint.X}, {virtualPoint.Y}).");
Infra\ScreenRecordService.cs (2)
481
WritePngUInt32(stream, buffer, crc, checked((uint)size.
Width
));
485
WritePngUInt32(stream, buffer, crc, checked((uint)offset.
Width
));
WindowsFormsIntegration (12)
System\Windows\Integration\Convert.cs (2)
236
Size returnSize = new Size((double)size.
Width
, (double)size.Height);
247
Size returnSize = new Size((double)size.
Width
, (double)size.Height);
System\Windows\Integration\ElementHost.cs (2)
317
int maxWidth = Math.Min(priorMaxSize.
Width
, maxElementSize.
Width
);
System\Windows\Integration\HostUtils.cs (8)
44
if (size.
Width
== 0) { size.Width = int.MaxValue; }
52
if (size.
Width
== 0 || size.
Width
== 1) { size.Width = int.MaxValue; }
59
if (size.
Width
== int.MaxValue)
73
Math.Max(size1.
Width
, size2.
Width
),
80
Math.Min(size1.
Width
, size2.
Width
),
WinFormsControlsTest (3)
ComboBoxesWithScrollBars.cs (1)
54
changeCBHeight_UpDown2.ValueChanged += (s, e) => comboBox2.Size = new Size(comboBox2.Size.
Width
, (int)changeCBHeight_UpDown2.Value);
MainForm.cs (2)
272
if (button.Width > biggestButton.
Width
)
294
(biggestButton.
Width
+ padding * 2) * 3 + padding * 2 + overarchingFlowLayoutPanel.Location.X * 2,