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