67 writes to Width
DesignSurface (1)
MainForm.cs (1)
328richTextBox.Width = toolStripContainer.Width;
PresentationUI (2)
MS\Internal\Documents\CredentialManagerDialog.cs (2)
170_addButton.Width = maxWidth; 171_removeButton.Width = maxWidth;
System.Windows.Forms (11)
System\Windows\Forms\ActiveX\AxHost.AxContainer.ExtenderProxy.cs (1)
256control.Width = Twip2Pixel(value, xDirection: true);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (1)
10171int vertScrollBarWidth = _vertScrollBar.Width = SystemInformation.VerticalScrollBarWidth;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (2)
85_detailsTextBox.Width = _overarchingTableLayoutPanel.Width - _detailsTextBox.Margin.Horizontal; 304_detailsButton.Width = (int)Math.Ceiling(detailsWidth * (_ownerGrid.UseCompatibleTextRendering ? 1.15f : 1.4f));
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
3725DropDownListBox.Width = Math.Max(maxWidth, GetRectangle(row, RowValue).Width);
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
265Width = requestedSize;
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (2)
382Width = _requestedDim; 710Width = _autoSize ? PreferredDimension : saveDim;
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
482_upDownButtons.Width = _defaultButtonsWidth;
System\Windows\Forms\Panels\SplitterPanel.cs (1)
283set => base.Width = value;
System\Windows\Forms\Printing\PrintPreviewControl.cs (1)
802_hScrollBar.Width = availableRect.Width - (verticalScrollNeeded ? _vScrollBar.Width : 0);
System.Windows.Forms.Design (10)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (2)
106listBox.Width = Math.Max(maxWidth, EditRegionSize.Width); 338hostedControl.Width = Math.Max(hostedControl.Width, EditRegionSize.Width - 2);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
48Width = width;
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
115EditControl.Width = _editRegionSize.Width - GetTextBoxRightPadding(textBoxPreferredHeight) - GetTextBoxLeftPadding(textBoxPreferredHeight) - specialPadding;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (1)
116Width = Math.Max(Width, PreferredWidth + (SystemInformation.VerticalScrollBarWidth * 2));
System\Windows\Forms\Design\DesignBindingPicker.cs (3)
173Width = _addNewCtrl.Height, 298Width = addNewWidth, 579Width = Math.Max(Width, _treeViewCtrl is null ? 0 : _treeViewCtrl.PreferredWidth + (SystemInformation.VerticalScrollBarWidth * 2));
System\Windows\Forms\Design\SelectionUIHandler.cs (1)
498controls[i].Width = size.Width;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1522_miniToolStrip.Width = _centerLabel.Width + 2;
System.Windows.Forms.Tests (35)
System\Windows\Forms\AccessibleObjects\DataGridViewCellAccessibleObjectTests.cs (2)
39Width = 85 71Width = 85
System\Windows\Forms\ControlTests.Methods.cs (5)
1877Width = 20, 1891Width = 20, 1928Width = 20, 1942Width = width, 1956Width = 20,
System\Windows\Forms\ControlTests.Properties.cs (12)
13146control.Width = value; 13165control.Width = value; 13256control.Width = value; 13275control.Width = value; 13344control.Width = value; 13363control.Width = value; 13452control.Width = value; 13472control.Width = value; 13564control.Width = value; 13586control.Width = value; 13701control.Width = value; 13728control.Width = value;
System\Windows\Forms\ScrollableControlTests.cs (1)
230Width = childWidth,
System\Windows\Forms\SplitterTests.cs (9)
430Width = 50, 496Width = 50, 1142Width = 100, 1197Width = 100, 1242Width = 100, 1314Width = 100, 1361Width = 100, 2009Width = 100, 2110Width = 100,
TextBoxBaseTests.cs (1)
3920Width = 0
WebBrowserBaseTests.cs (5)
669Width = 20, 683Width = 20, 720Width = 20, 734Width = width, 748Width = 20,
System.Windows.Forms.UI.IntegrationTests (2)
DesignBehaviorsTests.cs (1)
43treeView.Width = 100;
ListBoxItemAccessibleObjestTests.cs (1)
26listBox.Width = 100;
WinFormsControlsTest (6)
FormShowInTaskbar.cs (2)
13Width = 600; 33Width = 680,
RichTextBoxes.cs (3)
121Width = 500, 129TextBox textBox = new() { Left = 50, Top = 50, Width = 400 }; 130Button confirmation = new() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
TrackBars.cs (1)
43trackBar1.Width = ClientRectangle.Width - trackBar1.Left * 2;
499 references to Width
DesignSurface (1)
MainForm.cs (1)
328richTextBox.Width = toolStripContainer.Width;
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\Helpers\VBInputBox.vb (1)
92Dim labelSizeNeeded As SizeF = labelGraphics.MeasureString(prompt, Label.Font, Label.Width)
PresentationUI (3)
MS\Internal\Documents\CredentialManagerDialog.cs (2)
169int maxWidth = Math.Max(_addButton.Width, _removeButton.Width);
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
122get { return _listBoxSummary.Width - IconWidth; }
System.Windows.Forms (145)
System\Windows\Forms\ActiveX\AxHost.AxContainer.ExtenderProxy.cs (1)
251get => Pixel2Twip(GetControl()?.Width ?? 0, xDirection: true);
System\Windows\Forms\ActiveX\AxHost.cs (1)
1558SetExtent(Width, Height);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
465PInvoke.SetWindowExtEx(hdcDraw, _control.Width, _control.Height, (SIZE*)&sWindowExt); 2017rect.right = rect.left + _control.Width;
System\Windows\Forms\BoundsSpecified.cs (1)
40/// Both <see cref="Control.Width"/> and <see cref="Control.Height"/>
System\Windows\Forms\Control.cs (8)
4875int width = Math.Min(Width, targetBounds.Width); 8186Rectangle shift = new(-Left, -Top, parent.Width, parent.Height); 8688viewportOrg.X + Width, 10015/// <param name="width">The new <see cref="Width" /> property value of the control.</param> 10761bool newSize = Width != width || Height != height || _clientWidth != clientWidth || _clientHeight != clientHeight; 11080client = new Point(Width / 2, Height / 2); 11871if ((wp->flags & SET_WINDOW_POS_FLAGS.SWP_NOSIZE) == 0 && (wp->cx != Width || wp->cy != Height)) 12604if (sizeProperty is not null && !sizeProperty.IsReadOnly && (bounds.Width != Width || bounds.Height != Height))
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
383Control.Width - (2 * ButtonBorderSize),
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
431get => Properties.TryGetValue(s_propDropDownWidth, out int dropDownWidth) ? dropDownWidth : Width; 3808if (Width == 0)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (3)
470_vertScrollBar.Left = ClientRectangle.Width - _vertScrollBar.Width; 2130rectDisplay.Width -= _vertScrollBar.Width; 2133rectDisplay.X = _vertScrollBar.Width;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (8)
8990minimumWidth += _vertScrollBar.Width; 10307rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10309_vertScrollBar.Width, 10365rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10367_vertScrollBar.Width, 18805pt.X += Width; 19845_editingPanel.Location = new Point(Width + 1, 0); 29961client = new Point(Width / 2, Height / 2);
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (16)
404if (!Application.RenderWithVisualStyles || Width < 10 || Height < 10) 434new Rectangle(0, 0, Width, Height), 445new Rectangle(0, 0, Width, Height), 541int textRight = Math.Min(textLeft + textSize.Width, Width - 6); 5520, Height - 1, Width, Height - 1, // Bottom 554textRight, boxTop, Width - 1, boxTop, // Top-right 555Width - 1, boxTop, Width - 1, Height - 1 // Right 5760, Height - 1, Width, Height - 1, // Bottom 578textRight, boxTop, Width - 1, boxTop, // Top-right 579Width - 1, boxTop - 1, Width - 1, Height - 1 // Right 5850, Height - 2, Width - 1, Height - 2, // Bottom 587textRight, boxTop - 1, Width - 2, boxTop - 1, // Top-right 588Width - 2, boxTop - 1, Width - 2, Height - 2 // Right
System\Windows\Forms\Controls\Labels\Label.cs (2)
89_requestedWidth = Width; 1435Rectangle rectInScreen = RectangleToScreen(new Rectangle(0, 0, Width, Height));
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.cs (1)
84Rectangle dropDownButtonRect = new(0, 0, Width, Height);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (1)
85_detailsTextBox.Width = _overarchingTableLayoutPanel.Width - _detailsTextBox.Margin.Horizontal;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (1)
70Size = new(Width, 1 + value * _lineHeight);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
2955MoveSplitterTo(Width / 2);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (5)
296int oldWidth = Width; 297Size newSize = new(2 * DropDownHolderBorder + _currentControl.Width, 2 * DropDownHolderBorder + _currentControl.Height); 315Left -= (Width - oldWidth); 519e.Graphics.DrawLine(pen, 0, y, Width, y); 600Size size = new(2 * DropDownHolderBorder + control.Width, 2 * DropDownHolderBorder + control.Height);
System\Windows\Forms\Controls\Splitter\Splitter.cs (3)
659dockWidth += ctl.Width; 791size = splitTarget.Width + delta; 794size = splitTarget.Width - delta;
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (2)
1248if (Width == 0 || Height == 0) 2050client = new Point(Width / 2, Height / 2);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (2)
1827position.Offset(control.IsMirrored ? Width : -Width, 0);
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (1)
82preferredSize = new Size(ParentInternal.Width, GripThickness);
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
101bounds.Width = ParentInternal.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (2)
648controlLocation = new Point(Width - controlArray[i].Right, controlLocation.Y); 679screenLocation.Offset(-toolStripToDrag.Width, 0);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (1)
438int controlToDragWidth = (toolStripToDrag.AutoSize) ? toolStripToDrag.PreferredSize.Width : toolStripToDrag.Width;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (8)
933g.FillRectangle(brush, toolStrip.Width - 1, toolStrip.Height - 2, 1, 1); 934g.FillRectangle(brush, toolStrip.Width - 2, toolStrip.Height - 1, 1, 1); 939g.FillRectangle(brush, toolStrip.Width - 2, 0, 1, 1); 940g.FillRectangle(brush, toolStrip.Width - 1, 1, 1, 1); 1026e.Graphics.DrawLine(p, 0, 0, e.ToolStrip.Width, 0); 1149b.TranslateTransform(parent.Width - control.Location.X, parent.Height - control.Location.Y); 1478bounds.Width = dropDownMenu.Width - bounds.X; 1485bounds.Width = dropDownMenu.Width - bounds.X - dropDownMenu.Padding.Right;
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 (2)
268return new Size(parent.Width - (parent.Padding.Horizontal - dropDownMenu.ImageMargin.Width), SeparatorThickness); 314rect.Width = dropDownMenu.Width - 4;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (2)
143insertionRect = new Rectangle(_owner.Margin.Left, item.Bounds.Top, _owner.Width - (_owner.Margin.Horizontal) - 1, ToolStrip.s_insertionBeamWidth); 146insertionRect = new Rectangle(_owner.Margin.Left, item.Bounds.Bottom, _owner.Width - (_owner.Margin.Horizontal) - 1, ToolStrip.s_insertionBeamWidth);
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (2)
766e.Graphics.DrawLine(SystemPens.ButtonHighlight, 0, 0, e.ToolStrip.Width, 0); 776vsRenderer.DrawBackground(e.Graphics, new Rectangle(0, 0, e.ToolStrip.Width - 1, e.ToolStrip.Height - 1));
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.ToolStripTextBoxControl.cs (5)
117using RegionScope hTotalRegion = new(0, 0, Width, Height); 258g.FillRectangle(brush, 0, 0, Width, clientRect.Top); // top border 260g.FillRectangle(brush, 0, clientRect.Bottom, Width, Height - clientRect.Height); // bottom border 261g.FillRectangle(brush, clientRect.Right, 0, Width - clientRect.Right, Height); // right border 265g.DrawRectangle(pen, 0, 0, Width - 1, Height - 1);
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
1932int oldSize = Width;
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (1)
525width = SizeFromClientSizeInternal(new(width, height)).Width + _upDownButtons.Width;
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (1)
829int width = SizeFromClientSizeInternal(new(textWidth, height)).Width + _upDownButtons.Width;
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1356client = new Point(Width / 2, Height / 2);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.WebBrowserBaseNativeWindow.cs (1)
47wp->cx = _webBrowserBase.Width;
System\Windows\Forms\Form.cs (3)
3914p.X = Math.Max(screenRect.X, screenRect.X + (screenRect.Width - Width) / 2); 4355Point pointToSnap = new(button.Left + button.Width / 2, button.Top + button.Height / 2); 5225if (WindowState == FormWindowState.Normal && (Height != height || Width != width))
System\Windows\Forms\Layout\CommonProperties.cs (1)
270/// <see cref="Control.Width"/>, <see cref="Control.Height"/>, <see cref="Control.Bounds"/>, property. (Its the
System\Windows\Forms\Layout\Containers\ContainerControl.cs (1)
1385float xScaleFactor = (float)suggestedRectangle.Width / Width;
System\Windows\Forms\Layout\Containers\SplitContainer.cs (38)
360_panelSize = Width - SplitterDistanceInternal - SplitterWidthInternal; 393return (Width >= Panel1MinSize + SplitterWidthInternal + Panel2MinSize); 657if (value + SplitterWidthInternal > Width - Panel2MinSize) 659value = Width - Panel2MinSize - SplitterWidthInternal; 701_panelSize = Width - SplitterDistance - SplitterWidthInternal; 964_splitterDistance = (_splitterDistance + SplitterWidth > Width - Panel2MinSize - _borderSize) ? _splitterDistance - SplitterIncrement : _splitterDistance; 1092x = Math.Max(Math.Min(x, Width - Panel2MinSize), Panel1MinSize); 1259if (DesignMode && Width != DefaultSize.Width && value + Panel2MinSize + SplitterWidth > Width) 1288if (DesignMode && Width != DefaultSize.Width && value + Panel1MinSize + SplitterWidth > Width) 1317if (DesignMode && value + Panel1MinSize + Panel2MinSize > Width) 1392r.X = Width - splitSize - SplitterWidthInternal; 1398r.Width = Width; 1523return Math.Max(Math.Min(size, Width - Panel2MinSize), Panel1MinSize); 1571_splitterRect.X = ((RightToLeft == RightToLeft.Yes) ? Width - _splitterDistance - SplitterWidthInternal : Location.X + _splitterDistance); 1580_splitterRect.Width = Width; 1598if (Width == 0) 1620Panel2.Size = new Size(Math.Max(Width - _panelSize - SplitterWidthInternal, Panel2MinSize), Height); 1626_splitterDistance = Math.Max(Width - _panelSize - SplitterWidthInternal, Panel1MinSize); 1635_splitterDistance = Math.Max((int)(Math.Floor(Width / _ratioWidth)), Panel1MinSize); 1640Panel2.Size = new Size(Math.Max(Width - _splitterDistance - SplitterWidthInternal, Panel2MinSize), Height); 1649Panel1.Location = new Point(Width - Panel1.WidthInternal, 0); 1677Panel1.Size = new Size(Width, _panelSize); 1679Panel2.Size = new Size(Width, Math.Max(Height - panel2Start, Panel2MinSize)); 1685Panel2.Size = new Size(Width, _panelSize); 1688Panel1.WidthInternal = Width; 1702Panel1.WidthInternal = Width; 1704Panel2.Size = new Size(Width, Math.Max(Height - panel2Start, Panel2MinSize)); 2115if (size + SplitterWidthInternal <= Width - Panel2MinSize - _borderSize) 2178Panel2.Size = new Size(Width - _splitterDistance - SplitterWidthInternal, Height); 2187Panel1.Location = new Point(Width - _splitterDistance, 0); 2195_ratioWidth = (Width / (double)(Panel1.Width) > 0) ? Width / (double)(Panel1.Width) : _ratioWidth; 2214_ratioWidth = (Width / (double)(_splitterDistance) > 0) ? Width / (double)(_splitterDistance) : _ratioWidth; 2224Panel1.WidthInternal = Width; 2228Panel2.Size = new Size(Width, Height - panel2Start);
System\Windows\Forms\Panels\SplitterPanel.cs (2)
276get => Collapsed ? 0 : base.Width; 282get => base.Width;
System\Windows\Forms\Printing\PrintPreviewControl.cs (9)
450rect.Width -= _vScrollBar.Width; 454rect.X += _vScrollBar.Width; 462private Rectangle FocusRectangle => new(0, 0, Width - 1, Height - 1); 464private Rectangle ResizeBoxRectangle => new(_vScrollBar.Left, _hScrollBar.Top, _vScrollBar.Width, _hScrollBar.Height); 802_hScrollBar.Width = availableRect.Width - (verticalScrollNeeded ? _vScrollBar.Width : 0); 808offset: (verticalScrollNeeded ? _vScrollBar.Width : 0)); 827_vScrollBar.Left = availableRect.Right - _vScrollBar.Width; 854bool horizontal = _virtualSize.Width > displaySize.Width && displaySize.Width > _vScrollBar.Width; 859horizontal = _virtualSize.Width > (displaySize.Width - _vScrollBar.Width);
System.Windows.Forms.Design (57)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (1)
196Rectangle bounds = new(0, 0, Width, Height);
System\ComponentModel\Design\DesignerActionPanel.cs (2)
488e.Graphics.DrawRectangle(borderPen, new Rectangle(0, 0, Width - 1, Height - 1)); 506int lineWidth = Width;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
338hostedControl.Width = Math.Max(hostedControl.Width, EditRegionSize.Width - 2);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (5)
70ButtonRenderer.DrawButton(g, new Rectangle(-1, -1, Width + 2, Height + 2), "…", Font, Focused, buttonState); 93ComboBoxRenderer.DrawDropDownButton(g, new Rectangle(0, 0, Width, Height), state); 116new Rectangle(-1, -1, Width + 2, Height + 2), 138(Width - imageWidth + 1) / 2, 155ControlPaint.DrawFocusRectangle(g, new Rectangle(2, 2, Width - 5, Height - 5));
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
36int width = Math.Max(_hostedControl.Width, SystemInformation.MinimumWindowSize.Width);
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
276pt.X -= c.Width;
System\Windows\Forms\Design\Behavior\DesignerActionGlyph.cs (1)
137topRight.X += relatedControl.Width;
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (1)
548_dragOffset.Offset(-rootControl.Width, 0);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (3)
455initialDropPoint.Offset(-((Control)(_dragComponents[_primaryComponentIndex].dragComponent)).Width, 0); 828dropPoint.Offset(-c.Width, 0); 890_parentLocation.Offset(-parentControl.Width, 0);
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (3)
562(targetControl.Width == minWidth)) 930if (propWidth is not null && _resizeComponents[i].resizeControl.Width != _resizeComponents[i].resizeBounds.Width) 932propWidth.SetValue(_resizeComponents[i].resizeControl, _resizeComponents[i].resizeControl.Width);
System\Windows\Forms\Design\ControlCommandSet.cs (4)
480lines.Add(new SnapLine(SnapLineType.Right, pt.X + primaryControl.Width - 1)); 481lines.Add(new SnapLine(SnapLineType.Vertical, pt.X + primaryControl.Width + primaryControl.Margin.Right, SnapLine.MarginRight, SnapLinePriority.Always)); 718primaryControl.Width + moveOffsetX, primaryControl.Height + moveOffsetY); 725moveOffsetX = newRect.Width - primaryControl.Width;
System\Windows\Forms\Design\ControlDesigner.cs (2)
298offset.Offset(Control.Width, 0); 348int width = Control.Width;
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (3)
307_sampleDataGridView.Columns[0].Width = _sampleDataGridView.Width; 310_sampleDataGridViewSelected.Columns[0].Width = _sampleDataGridViewSelected.Width; 333dataGridView.Columns[0].Width = dataGridView.Width;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
907Rectangle bounds = new(0, selectedIndex * _selectedColumns.ItemHeight, _selectedColumns.Width, _selectedColumns.ItemHeight);
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (1)
116Width = Math.Max(Width, PreferredWidth + (SystemInformation.VerticalScrollBarWidth * 2));
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
579Width = Math.Max(Width, _treeViewCtrl is null ? 0 : _treeViewCtrl.PreferredWidth + (SystemInformation.VerticalScrollBarWidth * 2));
System\Windows\Forms\Design\DesignerUtils.cs (2)
390Math.Max(control.Width, s_minimumControlBitmapSize), 423Math.Max(control.Width, s_minimumControlBitmapSize),
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
806controlOffset.X += Control.Width;
System\Windows\Forms\Design\FormatControl.cs (6)
351thirdRowLabel.MaximumSize = new Drawing.Size(tableLayoutPanel1.Width, 0); 360tableLayoutPanel1.MinimumSize = new Drawing.Size(tableLayoutPanel1.Width, tableLayoutPanel1.Height); 373minWidth = nullValueLabel.Width; 377minWidth = Math.Max(minWidth, secondRowLabel.Width); 381minWidth = Math.Max(minWidth, secondRowLabel.Width); 409explanationLabel.Size = new Drawing.Size(formatGroupBox.Width - 10, 30);
System\Windows\Forms\Design\FormatStringDialog.cs (1)
99int result = ctl.Width;
System\Windows\Forms\Design\MaskDesignerDialog.cs (3)
73_maskDescriptionHeader.Width = _listViewCannedMasks.Width / 3; 78_dataFormatHeader.Width = _listViewCannedMasks.Width / 3; 83_validatingTypeHeader.Width = (_listViewCannedMasks.Width / 3) - SystemInformation.VerticalScrollBarWidth - 4; // so no h-scrollbar.
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
420if (newChild.Left == 0 && newChild.Top == 0 && newChild.Width >= Control.Width && newChild.Height >= Control.Height)
System\Windows\Forms\Design\ToolStripDesigner.cs (3)
730int width = _tn.EditorToolStrip.Width; 823_editorNode.Width = _tn.EditorToolStrip.Width; 2260_editorNode.Width = _tn.EditorToolStrip.Width;
System\Windows\Forms\Design\ToolStripItemDesigner.cs (2)
1232ToolStripItem.Width = _editorNode.EditorToolStrip.Width + 2; 1259boundsInAdornerWindow.X += (ToolStripItem.Width - _editorNode.EditorToolStrip.Width) / 2;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (3)
376int width = _typeHereTemplateNode.EditorToolStrip.Width; 754int width = _commitedTemplateNode.EditorToolStrip.Width; 1181if (_toolStripAdornerWindowService is not null && (dropDown.Width < _dropDownSizeToInvalidate.Width || dropDown.Size.Height < _dropDownSizeToInvalidate.Height))
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
557nameof(ToolStripPanel.Width),
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
1683return new Size(Width, s_toolStripTempateHeight); 1687return new Size(Width, s_templateHeight);
System.Windows.Forms.Design.Tests (8)
System\ComponentModel\Design\ByteViewerTests.cs (7)
35Assert.Equal(new Rectangle(0, 0, control.Width, control.Height), control.Bounds); 43Assert.Equal(new Rectangle(0, 0, control.Width, control.Height), control.ClientRectangle); 44Assert.Equal(new Size(control.Width, control.Height), control.ClientSize); 65Assert.Equal(new Rectangle(0, 0, control.Width, control.Height), control.DisplayRectangle); 116Assert.Equal(new Size(control.Width, control.Height), control.Size); 127Assert.True(control.Width > 0); 145Assert.Equal(control.Width, createParams.Width);
System\Windows\Forms\Design\FormatStringDialogTests.cs (1)
90int result = ctl.Width;
System.Windows.Forms.Tests (267)
System\Windows\Forms\AxHostTests.cs (2)
114Assert.Equal(75, control.Width); 208Assert.Equal(75, control.Width);
System\Windows\Forms\ButtonBaseTests.cs (1)
120Assert.Equal(75, control.Width);
System\Windows\Forms\ButtonRenderingTests.cs (1)
242new Rectangle(0, 0, button.Width - 1, button.Height - 1),
System\Windows\Forms\ButtonTests.cs (1)
118Assert.Equal(75, control.Width);
System\Windows\Forms\CheckBoxTests.cs (1)
121Assert.Equal(104, control.Width);
System\Windows\Forms\ComboBoxTests.cs (1)
130Assert.Equal(121, control.Width);
System\Windows\Forms\ContainerControlTests.cs (1)
121Assert.Equal(0, control.Width);
System\Windows\Forms\ControlTests.cs (5)
96Assert.Equal(0, control.Width); 185Assert.Equal(0, control.Width); 281Assert.Equal(width, control.Width); 377Assert.Equal(0, control.Width); 473Assert.Equal(width, control.Width);
System\Windows\Forms\ControlTests.Methods.cs (74)
7424Assert.Equal(width, control.Width); 7443Assert.Equal(width, control.Width); 7535Assert.Equal(expectedWidth, control.Width); 7554Assert.Equal(expectedWidth, control.Width); 7633Assert.Equal(width, control.Width); 7652Assert.Equal(width, control.Width); 7751Assert.Equal(width, control.Width); 7771Assert.Equal(width, control.Width); 7874Assert.Equal(expectedWidth, control.Width); 7896Assert.Equal(expectedWidth, control.Width); 8022Assert.Equal(expectedWidth, control.Width); 8049Assert.Equal(expectedWidth, control.Width); 8211Assert.Equal(expectedWidth, control.Width); 8230Assert.Equal(expectedWidth, control.Width); 8322Assert.Equal(expectedWidth, control.Width); 8341Assert.Equal(expectedWidth, control.Width); 8420Assert.Equal(expectedWidth, control.Width); 8439Assert.Equal(expectedWidth, control.Width); 8608Assert.Equal(expectedWidth, control.Width); 8628Assert.Equal(expectedWidth, control.Width); 8731Assert.Equal(expectedWidth, control.Width); 8753Assert.Equal(expectedWidth, control.Width); 8879Assert.Equal(expectedWidth, control.Width); 8906Assert.Equal(expectedWidth, control.Width); 9025Assert.Equal(width, control.Width); 9046Assert.Equal(width, control.Width); 9167Assert.Equal(expectedWidth, control.Width); 9188Assert.Equal(expectedWidth, control.Width); 9296Assert.Equal(width, control.Width); 9317Assert.Equal(width, control.Width); 9433Assert.Equal(width, control.Width); 9455Assert.Equal(width, control.Width); 9588Assert.Equal(expectedWidth, control.Width); 9612Assert.Equal(expectedWidth, control.Width); 9746Assert.Equal(expectedWidth, control.Width); 9775Assert.Equal(expectedWidth, control.Width); 9857Assert.Equal(expectedSize.Width, control.Width); 9873Assert.Equal(expectedSize.Width, control.Width); 9905Assert.Equal(expectedSize.Width, control.Width); 9924Assert.Equal(expectedSize.Width, control.Width); 10380Assert.Equal(0, control.Width); 10399Assert.Equal(0, control.Width); 10447Assert.True(control.Width > 0); 10480Assert.True(control.Width > 0); 10554Assert.Equal(0, control.Width); 10573Assert.Equal(0, control.Width); 10646Assert.Equal(0, control.Width); 10665Assert.Equal(0, control.Width); 10737Assert.Equal(0, control.Width); 10759Assert.Equal(0, control.Width); 10804Assert.Equal(3, control.Width); 10826Assert.Equal(3, control.Width); 10882Assert.Equal(3, control.Width); 10908Assert.Equal(3, control.Width); 10994Assert.Equal(width, control.Width); 11013Assert.Equal(width, control.Width); 11105Assert.Equal(width, control.Width); 11124Assert.Equal(width, control.Width); 11203Assert.Equal(width, control.Width); 11222Assert.Equal(width, control.Width); 11312Assert.Equal(width, control.Width); 11332Assert.Equal(width, control.Width); 11435Assert.Equal(width, control.Width); 11457Assert.Equal(width, control.Width); 11564Assert.Equal(width, control.Width); 11591Assert.Equal(width, control.Width); 11689Assert.Equal(width, control.Width); 11708Assert.Equal(width, control.Width); 11798Assert.Equal(width, control.Width); 11818Assert.Equal(width, control.Width); 11933Assert.Equal(width, control.Width); 11955Assert.Equal(width, control.Width); 12062Assert.Equal(width, control.Width); 12089Assert.Equal(width, control.Width);
System\Windows\Forms\ControlTests.Properties.cs (76)
2486Assert.Equal(width, control.Width); 2505Assert.Equal(width, control.Width); 2575Assert.Equal(expectedWidth, control.Width); 2594Assert.Equal(expectedWidth, control.Width); 2660Assert.Equal(width, control.Width); 2679Assert.Equal(width, control.Width); 2765Assert.Equal(width, control.Width); 2785Assert.Equal(width, control.Width); 2865Assert.Equal(expectedWidth, control.Width); 2887Assert.Equal(expectedWidth, control.Width); 2990Assert.Equal(expectedWidth, control.Width); 3017Assert.Equal(expectedWidth, control.Width); 3389Assert.Equal(expectedSize.Width, control.Width); 3405Assert.Equal(expectedSize.Width, control.Width); 3452Assert.Equal(expectedSize.Width, control.Width); 3471Assert.Equal(expectedSize.Width, control.Width); 5736Assert.Equal(0, control.Width); 5755Assert.Equal(0, control.Width); 5846Assert.Equal(expectedWidth, control.Width); 5865Assert.Equal(expectedWidth, control.Width); 5934Assert.Equal(0, control.Width); 5953Assert.Equal(0, control.Width); 6042Assert.Equal(0, control.Width); 6062Assert.Equal(0, control.Width); 6154Assert.Equal(0, control.Width); 6176Assert.Equal(0, control.Width); 6291Assert.Equal(0, control.Width); 6318Assert.Equal(0, control.Width); 6700Assert.Equal(0, control.Width); 6722Assert.Equal(0, control.Width); 6791Assert.Equal(0, control.Width); 6813Assert.Equal(0, control.Width); 6890Assert.Equal(0, control.Width); 6915Assert.Equal(0, control.Width); 7000Assert.Equal(0, control.Width); 7029Assert.Equal(0, control.Width); 7181Assert.Equal(0, control.Width); 7203Assert.Equal(0, control.Width); 7271Assert.Equal(0, control.Width); 7294Assert.Equal(0, control.Width); 7373Assert.Equal(0, control.Width); 7398Assert.Equal(0, control.Width); 7484Assert.Equal(0, control.Width); 7514Assert.Equal(0, control.Width); 11120Assert.Equal(value.Width, control.Width); 11139Assert.Equal(value.Width, control.Width); 11231Assert.Equal(expectedWidth, control.Width); 11250Assert.Equal(expectedWidth, control.Width); 11326Assert.Equal(value.Width, control.Width); 11345Assert.Equal(value.Width, control.Width); 11441Assert.Equal(value.Width, control.Width); 11461Assert.Equal(value.Width, control.Width); 11558Assert.Equal(expectedWidth, control.Width); 11580Assert.Equal(expectedWidth, control.Width); 11700Assert.Equal(expectedWidth, control.Width); 11727Assert.Equal(expectedWidth, control.Width); 12135Assert.Equal(0, control.Width); 12156Assert.Equal(0, control.Width); 12225Assert.Equal(0, control.Width); 12247Assert.Equal(0, control.Width); 12323Assert.Equal(0, control.Width); 12347Assert.Equal(0, control.Width); 12432Assert.Equal(0, control.Width); 12461Assert.Equal(0, control.Width); 13155Assert.Equal(value, control.Width); 13174Assert.Equal(value, control.Width); 13265Assert.Equal(expectedWidth, control.Width); 13284Assert.Equal(expectedWidth, control.Width); 13353Assert.Equal(value, control.Width); 13372Assert.Equal(value, control.Width); 13461Assert.Equal(value, control.Width); 13481Assert.Equal(value, control.Width); 13573Assert.Equal(expectedWidth, control.Width); 13595Assert.Equal(expectedWidth, control.Width); 13710Assert.Equal(expectedWidth, control.Width); 13737Assert.Equal(expectedWidth, control.Width);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
127Assert.Equal(100, control.Width);
System\Windows\Forms\DateTimePickerTests.cs (1)
121Assert.Equal(200, control.Width);
System\Windows\Forms\Design\ComponentEditorFormTests.cs (7)
48Assert.Equal(new Rectangle(0, 0, control.Width, control.Height), control.Bounds); 76Assert.Equal(new Rectangle(-SystemInformation.WorkingArea.X, -SystemInformation.WorkingArea.Y, control.Width, control.Height), control.DesktopBounds); 136Assert.Equal(new Rectangle(-1, -1, control.Width, control.Height), control.RestoreBounds); 137Assert.Equal(control.Width, control.Right); 146Assert.Equal(new Size(control.Width, control.Height), control.Size); 162Assert.True(control.Width > 0); 182Assert.Equal(control.Width, createParams.Width);
System\Windows\Forms\Design\ComponentEditorPageTests.cs (1)
124Assert.Equal(200, control.Width);
System\Windows\Forms\DomainUpDownTests.cs (1)
150_sub.Width.Should().Be(120);
System\Windows\Forms\FlowLayoutPanelTests.cs (1)
115Assert.Equal(200, control.Width);
System\Windows\Forms\FormTests.cs (1)
164Assert.Equal(300, control.Width);
System\Windows\Forms\GroupBoxTests.cs (1)
101Assert.Equal(200, control.Width);
System\Windows\Forms\HScrollBarTests.cs (1)
115Assert.True(control.Width > 0);
System\Windows\Forms\LabelTests.cs (1)
112Assert.Equal(100, control.Width);
System\Windows\Forms\ListBoxTests.cs (1)
133Assert.Equal(120, control.Width);
System\Windows\Forms\ListControlTests.cs (1)
109Assert.Equal(0, control.Width);
System\Windows\Forms\ListViewTests.cs (1)
151Assert.Equal(121, control.Width);
System\Windows\Forms\MdiClientTests.cs (11)
85Assert.Equal(0, control.Width); 545Assert.Equal(value.Width, control.Width); 564Assert.Equal(value.Width, control.Width); 647Assert.Equal(expectedWidth, control.Width); 669Assert.Equal(expectedWidth, control.Width); 781Assert.Equal(0, control.Width); 808Assert.Equal(0, control.Width); 933Assert.Equal(0, control.Width); 960Assert.Equal(0, control.Width); 1095Assert.Equal(expectedWidth, control.Width); 1122Assert.Equal(expectedWidth, control.Width);
System\Windows\Forms\MenuStripTests.cs (1)
147Assert.Equal(200, control.Width);
System\Windows\Forms\MonthCalendarTests.cs (2)
140Assert.True(control.Width > 0); 158Assert.Equal(control.Width, createParams.Width);
System\Windows\Forms\PanelTests.cs (1)
114Assert.Equal(200, control.Width);
System\Windows\Forms\PictureBoxTests.cs (1)
109Assert.Equal(100, control.Width);
System\Windows\Forms\ProgressBarTests.cs (1)
101Assert.Equal(100, control.Width);
System\Windows\Forms\PropertyGridTests.cs (1)
166Assert.Equal(130, control.Width);
System\Windows\Forms\RadioButtonTests.cs (1)
118Assert.Equal(104, control.Width);
System\Windows\Forms\RichTextBoxTests.cs (1)
133Assert.Equal(100, control.Width);
System\Windows\Forms\ScrollableControlTests.cs (1)
114Assert.Equal(0, control.Width);
System\Windows\Forms\ScrollBarTests.cs (1)
103Assert.Equal(0, control.Width);
System\Windows\Forms\SplitterTests.cs (11)
101Assert.Equal(3, control.Width); 406Assert.Equal(3, control.Width); 415Assert.Equal(3, control.Width); 439Assert.Equal(50, control.Width); 448Assert.Equal(50, control.Width); 471Assert.Equal(3, control.Width); 480Assert.Equal(3, control.Width); 505Assert.Equal(expectedWidth, control.Width); 514Assert.Equal(expectedWidth, control.Width); 663Assert.Equal(3, control.Width); 675Assert.Equal(3, control.Width);
System\Windows\Forms\StatusStripTests.cs (1)
150Assert.Equal(200, control.Width);
System\Windows\Forms\TabControlTests.cs (1)
112Assert.Equal(200, control.Width);
System\Windows\Forms\TableLayoutPanelTests.cs (1)
125Assert.Equal(200, control.Width);
System\Windows\Forms\TabPageTests.cs (18)
121Assert.Equal(200, control.Width); 230Assert.Equal(200, control.Width); 1907Assert.Equal(200, control.Width); 1929Assert.Equal(200, control.Width); 1997Assert.Equal(200, control.Width); 2020Assert.Equal(200, control.Width); 2098Assert.Equal(200, control.Width); 2123Assert.Equal(200, control.Width); 2222Assert.Equal(expected.Width, control.Width); 2252Assert.Equal(expected.Width, control.Width); 4353Assert.Equal(width, control.Width); 4374Assert.Equal(width, control.Width); 4490Assert.Equal(width, control.Width); 4512Assert.Equal(width, control.Width); 4645Assert.Equal(expectedWidth, control.Width); 4669Assert.Equal(expectedWidth, control.Width); 4824Assert.Equal(expected.Width, control.Width); 4854Assert.Equal(expected.Width, control.Width);
System\Windows\Forms\ToolStripContentPanelTests.cs (3)
119Assert.Equal(200, control.Width); 948Assert.Equal(200, control.Width); 970Assert.Equal(200, control.Width);
System\Windows\Forms\ToolStripControlHostTests.cs (1)
120Assert.Equal(c.Width, item.Width);
System\Windows\Forms\ToolStripDropDownTests.cs (3)
157Assert.Equal(2, control.Width); 1974Assert.Equal(100, control.Width); 1996Assert.Equal(100, control.Width);
System\Windows\Forms\ToolStripPanelTests.cs (1)
118Assert.Equal(0, control.Width);
System\Windows\Forms\ToolStripTests.cs (2)
163Assert.Equal(100, control.Width); 318Assert.Equal(100, control.Width);
System\Windows\Forms\TreeViewTests.cs (1)
128Assert.Equal(121, control.Width);
System\Windows\Forms\UpDownBaseTests.cs (3)
133Assert.Equal(120, control.Width); 2771Assert.Equal(width, control.Width); 2803Assert.Equal(width, control.Width);
System\Windows\Forms\UserControlTests.cs (1)
121Assert.Equal(150, control.Width);
System\Windows\Forms\VScrollBarTests.cs (1)
114Assert.True(control.Width > 0);
System\Windows\Forms\WebBrowserTests.cs (1)
97Assert.Equal(250, control.Width);
TextBoxBaseTests.cs (6)
6544Assert.Equal(width, control.Width); 6565Assert.Equal(width, control.Width); 6678Assert.Equal(width, control.Width); 6699Assert.Equal(width, control.Width); 6794Assert.Equal(width, control.Width); 6815Assert.Equal(width, control.Width);
TextBoxTests.cs (1)
120Assert.Equal(100, control.Width);
TrackBarTests.cs (3)
108Assert.Equal(104, control.Width); 3004Assert.Equal(expectedWidth, control.Width); 3025Assert.Equal(expectedWidth, control.Width);
WebBrowserBaseTests.cs (4)
83Assert.Equal(width, control.Width); 102Assert.Equal(width, control.Width); 199Assert.Equal(expectedWidth, control.Width); 221Assert.Equal(expectedWidth, control.Width);
System.Windows.Forms.UI.IntegrationTests (9)
Dpi\DpiMessageHelper.cs (1)
25(int)Math.Round(control.Width * factor),
DragDropTests.cs (1)
167WaitForExplorer(DragDrop, new Point(dragDropForm.Location.X + dragDropForm.Width, dragDropForm.Location.Y));
FormTests.cs (6)
65int borderSize = (form.Width - form.ClientRectangle.Width) / 2; 76Assert.True(form.Width >= screenWorkingArea.Width / 2); 77Assert.True(form.Width <= (screenWorkingArea.Width / 2) + (borderSize * 2)); 126int borderSize = (form.Width - form.ClientRectangle.Width) / 2; 137Assert.True(form.Width >= screenWorkingArea.Width / 2); 138Assert.True(form.Width <= (screenWorkingArea.Width / 2) + (borderSize * 2));
ListBoxItemAccessibleObjestTests.cs (1)
30boundsAfterHandleCreation.Width.Should().BeLessOrEqualTo(listBox.Width);
WindowsFormsIntegration (6)
System\Windows\Integration\ElementHost.cs (1)
635SafeNativeMethods.SetWindowPos(_hwndSource.Handle, NativeMethods.HWND_TOP, 0, 0, this.Width, this.Height, 0);
System\Windows\Integration\HostUtils.cs (5)
300int width = control.Width <= 0 ? 1 : control.Width; 301int height = control.Width <= 0 ? 1 : control.Height; 337drawingContext.DrawRectangle(brush, null, new Rect(0, 0, adapter.Width, adapter.Height)); 340RenderTargetBitmap bmp = GetRenderTargetBitmapForVisual(adapter.Width, adapter.Height, drawingVisual);
WinFormsControlsTest (2)
MainForm.cs (1)
272if (button.Width > biggestButton.Width)
TrackBars.cs (1)
27lblTrackBarSize.Text = $"Trackbar width: {trackBar1.Width}";