333 writes to Width
System.Drawing.Primitives (3)
System\Drawing\Rectangle.cs (3)
77Width = value.Width; 251Width += 2 * width; 280Width = result.Width;
System.Windows.Forms (267)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1415b.Width = p.Width;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
1705bounds.Width = adjusted.Width;
System\Windows\Forms\Control.cs (1)
8160rectangle.Width--;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (2)
396imageBounds.Width++; 469r.Width += 1;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (10)
302layout.Focus.Width--; 400layout.CheckArea.Width = checkSizeFull + 1; 406layout.Field.Width -= checkSizeFull + 1; 412layout.CheckArea.Width = checkSizeFull + 1; 417layout.Field.Width -= checkSizeFull + 1; 421layout.CheckArea.Width = field.Width; 432layout.CheckArea.Width = field.Width; 445layout.CheckBounds.Width -= CheckPaddingSize; 592layout.TextBounds.Width = textRight - layout.TextBounds.X; 598layout.ImageBounds.Width = Math.Max(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (6)
43bounds.Width--; 55bounds.Width--; 64bounds.Width++; 74bounds.Width++; 175fullSize.Width++; 179fullSize.Width++;
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (2)
46layout.Focus.Width = layout.TextBounds.Width + layout.ImageBounds.Width - 1; 54layout.Focus.Width += 2;
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (2)
45bounds.Width--; 85bounds.Width--;
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (2)
42_whiteFillRect.Width = WhiteFillRectWidth; 44_dropDownRect.Width -= WhiteFillRectWidth;
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (4)
2130rectDisplay.Width -= _vertScrollBar.Width; 2711rectTmp.Width++; 2721rectTmp.Width--; 2729rectTmp.Width -= totalVisibleFrozenWidth;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (50)
2466cursorClip.Width = Math.Min(frozenWidth, _layout.Data.Width); 2480cursorClip.Width = Math.Min(scrollingWidth, _layout.Data.Width); 2542clip.Width = leftEdge - Columns[columnIndex].MinimumThickness - _layout.Data.X + 3; 2547clip.Width -= overflowWidth; 2553clip.Width = _layout.Data.Right - leftEdge - 1; 2557clip.Width -= overflowWidth; 2748clip.Width -= MinimumRowHeadersWidth - 1; 4381inside.Width = 0; 4404rowHeaders.Width = Math.Min(RowHeadersWidth, rowHeaders.Width); 4414insideLeft.Width -= rowHeaders.Width; 4423topLeft.Width = Math.Min(RowHeadersWidth, topLeft.Width); 4424colHeaders.Width -= topLeft.Width; 4459insideLeft.Width--; 5495rectScrollingArea.Width -= emptyBackgroundWidth; 5511rectScrollingArea.Width -= frozenVisibleColumnsWidth; 6831rect.Width++; 7086rowRect.Width += width; 7095rowRect.Width += width; 9097rowRect.Width += _layout.RowHeaders.Width; 10223_layout.Data.Width -= vertScrollBarWidth; 10232_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10256_layout.ColumnHeaders.Width += vertScrollBarWidth; 10263_layout.Data.Width += vertScrollBarWidth; 10280_layout.Data.Width -= vertScrollBarWidth; 10289_layout.ColumnHeaders.Width -= vertScrollBarWidth; 14508rightArea.Width -= rightArea.Right - leftEdge; 14512rightArea.Width -= leftEdge - rightArea.X; 16757gridRect.Width++; 16798focusRect.Width -= change; 16805focusRect.Width += change; 16831edge.Width = 1; 19248rcNextRows.Width -= _layout.RowHeaders.Width; 19257rcNextRows.Width--; 19267rcNextRows.Width -= rowsWidth; 19304edge.Width = borderWidth; 19362cellBounds.Width = dataGridViewColumn.Thickness; 19365cellBounds.Width++; 19416scrollingBounds.Width += FirstDisplayedScrollingColumnHiddenWidth; 19430rowRect.Width -= cx; 19440cellBounds.Width = dataGridViewColumn.Thickness; 19443cellBounds.Width++; 19518columnHeadersClip.Width++; 19688cellBounds.Width = RowHeadersWidth; 19843editingZone.Width = Math.Max(0, editingZone.Width - totalVisibleFrozenWidth); 19882cellBounds.Width++; 19883cellClip.Width++; 26354rowsRect.Width++; 26381rowsRect.Width = _layout.RowHeaders.Width; 29021bottomArea.Width++; 29096bottomArea.Width++;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (5)
419s_rectThemeMargins.Width = DATAGRIDVIEWBUTTONCELL_themeMargin - rectContent.Right; 682valBounds.Width -= borderWidths.Right; 707valBounds.Width -= cellStyle.Padding.Horizontal; 963valBounds.Width -= 2 * DATAGRIDVIEWBUTTONCELL_horizontalTextMargin; 970valBounds.Width--;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (8)
848rect.Width = (advancedBorderStyle.Right == DataGridViewAdvancedCellBorderStyle.None) ? 0 : 1; 851rect.Width++; 868rect.Width += OwningColumn.DividerWidth; 3174bounds.Width -= dividerThickness; 3603rectPadding.Width = cellStyle.Padding.Left; 3612rectPadding.Width = cellStyle.Padding.Right; 3618rectPadding.Width = bounds.Width - cellStyle.Padding.Horizontal; 3808borderAndPaddingWidths.Width += cellStyle.Padding.Right;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (2)
361cellRect.Width = cellRight - cellLeft; 365cellRect.Width = 0;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (4)
1065valBounds.Width -= borderWidths.Right; 1131valBounds.Width -= cellStyle.Padding.Horizontal; 1318checkBounds.Width++; 1337fullSize.Width++;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (7)
767valBounds.Width -= borderWidths.Right; 788valBounds.Width -= cellStyle.Padding.Horizontal; 855valBounds.Width -= rectThemeMargins.X + rectThemeMargins.Width; 860valBounds.Width -= rectThemeMargins.X + rectThemeMargins.Width; 888valBounds.Width -= cellStyle.Padding.Horizontal; 906valBounds.Width -= HorizontalTextMarginLeft + HorizontalTextMarginRight; 937valBounds.Width -= s_sortGlyphSeparatorWidth +
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (16)
534borderAndPaddingWidths.Width += cellStyle.Padding.Right; 1767cellBounds.Width += DataGridView.FirstDisplayedScrollingColumnHiddenWidth; 1915valBounds.Width -= borderWidths.Right; 1948valBounds.Width -= cellStyle.Padding.Horizontal; 2176dropRect.Width++; 2193dropRect.Width--; 2218textBounds.Width++; 2225errorBounds.Width -= dropWidth; 2226textBounds.Width -= dropWidth; 2235errorBounds.Width -= dropWidth + 1; 2236textBounds.Width -= dropWidth + 1; 2263focusBounds.Width++; 2272focusBounds.Width -= 2; 2288valBounds.Width--; 2303textBounds.Width += 2 - HorizontalTextMarginLeft; 2308textBounds.Width += 1 - HorizontalTextMarginLeft;
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (2)
389s_rectThemeMargins.Width = ThemeMargin - rectContent.Right; 540bounds.Width -= borderWidths.Right;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (2)
747valBounds.Width -= borderWidths.Right; 771imageBounds.Width -= cellStyle.Padding.Horizontal;
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (5)
907valBounds.Width -= borderWidths.Right; 934valBounds.Width -= cellStyle.Padding.Horizontal; 944valBounds.Width -= HorizontalTextMarginLeft + HorizontalTextMarginRight; 994focusBounds.Width++; 999focusBounds.Width++;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (7)
1517cellBounds.Width = dataGridViewColumn.Thickness; 1520cellBounds.Width++; 1585dataBounds.Width += dataGridView.FirstDisplayedScrollingColumnHiddenWidth; 1597rowRect.Width -= cx; 1607cellBounds.Width = dataGridViewColumn.Thickness; 1610cellBounds.Width++; 1699cellBounds.Width = dataGridView.RowHeadersWidth;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (7)
649valBounds.Width -= borderWidths.Right; 669valBounds.Width -= cellStyle.Padding.Horizontal; 721valBounds.Width -= rectThemeMargins.Y + rectThemeMargins.Height; 753valBounds.Width -= cellStyle.Padding.Horizontal; 835valBounds.Width -= s_iconsWidth + 2 * RowHeaderIconMarginWidth; 843valBounds.Width -= HorizontalTextMarginLeft + 2 * ContentMarginWidth + HorizontalTextMarginRight; 865valBounds.Width -= s_iconsWidth + 2 * RowHeaderIconMarginWidth;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (1)
35cellRect.Width = Owner.DataGridView.RowHeadersWidth;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (8)
154editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 2); 159editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 1); 168editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - 3); 178editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight); 183editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight - 1); 672valBounds.Width -= borderWidths.Right; 702valBounds.Width -= cellStyle.Padding.Horizontal; 725valBounds.Width -= DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginLeft + DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginRight;
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (3)
236valBounds.Width -= borderWidths.Right; 292valBounds.Width -= cellStyle.Padding.Horizontal; 301valBounds.Width -= DATAGRIDVIEWTOPLEFTHEADERCELL_horizontalTextMarginLeft + DATAGRIDVIEWTOPLEFTHEADERCELL_horizontalTextMarginRight;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
465textRectangle.Width -= 2 * TextOffset;
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (8)
180textBounds.Width -= 2 * BoxHeaderWidth; 188textBounds.Width = measuredBounds.Width; 217clipLeft.Width = BoxHeaderWidth; 218clipMiddle.Width = Math.Max(0, textBounds.Width - 3); // -3 to account for the margin built in the MeasureText result 223clipRight.Width = clipMiddle.X - boxBounds.X; 229clipRight.Width = boxBounds.Right - clipRight.X; 283textBounds.Width -= TextOffset; 291textBounds.Width = measuredBounds.Width;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
2357bounds.Width = MultiColumn ? Math.Max(ColumnWidth, bounds.Width) : Math.Max(MaxItemWidth, bounds.Width);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
77bounds.Width = visibleArea.Width;
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (2)
103r.Width -= 1; 109r.Width -= 1;
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (2)
110resultBounds.Width++; 115resultBounds.Width -= 4;
System\Windows\Forms\Controls\ListView\ListView.cs (3)
2722subItemBounds.Width = _columnHeaders[0].Width; 5011rectInvalid.Width += rectInvalid.X; 5023rectInvalid.Width += ClientRectangle.Right - rectInvalid.Right;
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
368result.Width = (int)(imageSize.Width * ratio);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.SnappableControl.cs (1)
41r.Width--;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (1)
49inside.Width -= 3;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (3)
1556rect.Width = totalWidth - rect.X; 1856rectPaint.Width--; 1863rect.Width -= paintIndent + 2 * PropertyGridView.ValueStringIndent;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (9)
1892rect.Width = size.Width - 1; 1897rect.Width = LabelWidth - 1; 1902rect.Width = size.Width - LabelWidth; 2127r.Width -= r.X; 4315rect.Width -= 1; 4331rect.Width -= sizeBtn.Width; 4339rect.Width -= _paintIndent + 1; 4344rect.Width -= EditIndent + 1; 4374rect.Width -= 1;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
459newBounds.Width = _dragBaseRect.Width - delta;
System\Windows\Forms\Controls\Splitter\Splitter.cs (4)
410bounds.Width = value; 414bounds.Width = value; 581r.Width = minWeight; 589r.Width = minWeight;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
736rect.Width -= gripwidth; 4178gripRectangle.Width = Grip.GripThickness; 4195gripRectangle.Width = displayRect.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (1)
60options.Client.Width -= widthOfDropDown;
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (1)
339bounds.Width -= 1;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
101bounds.Width = ParentInternal.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (1)
1026bounds.Width = ParentInternal.DisplayRectangle.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
317bounds.Width -= spaceToFree;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
468cachedBounds.Width = (spaceToFree < 0) ? minSize.Width + -spaceToFree : minSize.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (3)
35displayRect.Width = ToolStripPanel.ParentInternal.DisplayRectangle.Width - (ToolStripPanel.Margin.Horizontal + ToolStripPanel.Padding.Horizontal) - Row.Margin.Horizontal; 39displayRect.Width = raftingDisplayRectangle.Width - Row.Margin.Horizontal; 70dragBounds.Width += Row.Margin.Horizontal + ToolStripPanel.Padding.Horizontal + 5;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (2)
60dragBounds.Width += dragBounds.X - x; 68dragBounds.Width += (nextRowBounds.Width >> 2) + Row.Margin.Right + ToolStripPanel.RowsInternal[index + 1].Margin.Left;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (6)
971beginGradient.Width = firstGradientWidth; 972endGradient.Width = secondGradientWidth + 1; 1004endGradient.Width -= 1; 1227overflowBoundsFill.Width = _overflowButtonWidth; 1478bounds.Width = dropDownMenu.Width - bounds.X; 1485bounds.Width = dropDownMenu.Width - bounds.X - dropDownMenu.Padding.Right;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
314rect.Width = dropDownMenu.Width - 4;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
310splitButtonButtonBounds.Width -= _splitterWidth;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (1)
162insertionRect.Width = ToolStrip.s_insertionBeamWidth;
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (3)
249bounds.Width -= 1; 313bounds.Width = 3; 449fillRect.Width -= 3; // its already 1 away from the right edge
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2762bounds.Width += value;
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (3)
550backRect.Width += 2; 565backRect.Width++; 571backRect.Width++;
System\Windows\Forms\Design\ComponentEditorForm.cs (1)
263bounds.Width = BUTTON_WIDTH;
System\Windows\Forms\Form.cs (3)
3070bounds.Width = correct.Width; 5192_restoredWindowBounds.Width = width; 5216_restoreBounds.Width = width;
System\Windows\Forms\Layout\CommonProperties.cs (3)
207bounds.Width = Math.Min(bounds.Width, value.Width); 231bounds.Width = Math.Max(bounds.Width, value.Width); 311originalBounds.Width = width;
System\Windows\Forms\Layout\Containers\SplitContainer.cs (6)
1379r.Width = SplitterWidthInternal; 1383r.Width = minWeight; 1398r.Width = Width; 1402r.Width = minWeight; 1573_splitterRect.Width = SplitterWidthInternal; 1580_splitterRect.Width = Width;
System\Windows\Forms\Layout\DefaultLayout.cs (2)
432remainingBounds.Width -= element.Bounds.Width; 444remainingBounds.Width -= element.Bounds.Width;
System\Windows\Forms\Layout\FlowLayout.cs (1)
71displayRect.Width = int.MaxValue - displayRect.X;
System\Windows\Forms\Layout\LayoutUtils.cs (8)
301withinThis.Width = alignThis.Width; 317withinThis.Width = alignThis.Width; 376rect.Width += padding.Horizontal; 385rect.Width -= padding.Horizontal; 509region1.Width = specifiedContent.Width; 511region2.Width -= specifiedContent.Width; 515region1.Width = specifiedContent.Width; 516region2.Width -= specifiedContent.Width;
System\Windows\Forms\Layout\TableLayout.cs (2)
1263cellBounds.Width = Math.Max(cellBounds.Width, 1); 1272elementBounds.Width = Math.Min(cellBounds.Width, elementBounds.Width);
System\Windows\Forms\Printing\PrintPreviewControl.cs (3)
430rect.Width = Math.Max(0, rect.Width - 1); 450rect.Width -= _vScrollBar.Width; 698box.Width--;
System\Windows\Forms\Rendering\ControlPaint.cs (4)
105result.Width = bounds.Width; 122result.Width = (int)((imageSize.Width * yRatio) + .5); 1417rectangle.Width--; 1502rectangle.Width--;
System\Windows\Forms\Rendering\TextExtensions.cs (1)
88bounds.Width -= bounds.X;
System\Windows\Forms\Scrolling\ScrollableControl.cs (7)
201rect.Width = _displayRect.Width; 223displayRectangle.Width = Math.Max(displayRectangle.Width, AutoScrollMinSize.Width); 292display.Width = client.Width; 325fullClient.Width += SystemInformation.VerticalScrollBarWidth; 329minClient.Width -= SystemInformation.VerticalScrollBarWidth; 508clientToBe.Width -= SystemInformation.VerticalScrollBarWidth; 1051_displayRect.Width = width;
System.Windows.Forms.Design (63)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (4)
572Rectangle button = e.Bounds with { Width = w }; 587Rectangle res = e.Bounds with { X = e.Bounds.X + offset, Width = e.Bounds.Width - offset }; 609e.Bounds with { Width = w }, format); 617e.Bounds with { X = e.Bounds.X + offset, Width = e.Bounds.Width - offset });
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (2)
210bounds.Width -= PushButtonWidth; 216bounds.Width -= PushButtonWidth;
System\Drawing\Design\ColorEditor.ColorPalette.cs (2)
125rect.Width = s_cellSizeX; 365Width = s_cellSizeX,
System\Drawing\Design\IconEditor.cs (1)
123rectangle.Width = icon.Width;
System\Drawing\Design\ImageEditor.cs (1)
177r.Width--;
System\Windows\Forms\Design\Behavior\NoResizeSelectionBorderGlyph.cs (1)
55hitBounds.Width += DesignerUtils.s_selectionBorderHitArea - DesignerUtils.s_selectionBorderSize;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (7)
99rect.Width += _parentGridSize.Width - xDelta; 103rect.Width -= xDelta; 112rect.Width -= _parentGridSize.Width - xDelta; 117rect.Width += xDelta; 149rect.Width = Math.Max(rect.Width, _parentGridSize.Width); 718bounds.Width = Math.Max(minWidth, baseBounds.Width + (!fRTL ? (mouseLoc.X - xOffset) : (xOffset - mouseLoc.X))); 732bounds.Width = Math.Max(minWidth, baseBounds.Width + xOffset);
System\Windows\Forms\Design\Behavior\SelectionBorderGlyph.cs (2)
68hitBounds.Width += DesignerUtils.s_selectionBorderHitArea - DesignerUtils.s_selectionBorderSize; 79hitBounds.Width += DesignerUtils.s_selectionBorderHitArea - DesignerUtils.s_selectionBorderSize;
System\Windows\Forms\Design\ComponentTray.cs (6)
1207_mouseDragWorkspace.Width = Math.Abs(end.X - start.X); 1342Width = Math.Abs(e.X - _mouseDragStart.X), 1996rc.Width = Math.Max(_cxIcon, sz.Width) + 4 * _borderWidth + 2 * WhiteSpace; 2001rc.Width = _cxIcon + sz.Width + 4 * _borderWidth + 2 * WhiteSpace; 2277rc.Width -= (2 * _borderWidth + WhiteSpace); 2306rc.Width -= _cxIcon;
System\Windows\Forms\Design\ControlDesigner.cs (2)
2248borderRectangle.Width -= 2; 2255textRect.Width -= (textRect.X + marginX + penThickness);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
990bounds.Width -= listBoxItem.ToolboxBitmap.Width + 2 * OWNERDRAWITEMIMAGEBUFFER;
System\Windows\Forms\Design\DesignerUtils.cs (2)
484bounds.Width += 2 * offset; 488bounds.Width += 2 * offset;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (3)
211bounds.Width += margin.Horizontal; 226bounds.Width -= 1; 328_childInfo[controlIndex].MarginBounds.Width = size.Size;
System\Windows\Forms\Design\GroupBoxDesigner.cs (1)
80rectangle.Width++; // gpr: FillRectangle with a TextureBrush comes up one pixel short
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
414rectangle.Width = 5;
System\Windows\Forms\Design\PanelDesigner.cs (1)
39rc.Width--;
System\Windows\Forms\Design\ParentControlDesigner.cs (9)
506bounds.Width = size.Width; 1095adjustedRect.Width = dragRect.Width; 1172updatedRect.Width = ((dragRect.X + dragRect.Width) / gridSize.Width) * gridSize.Width - updatedRect.X; 1178updatedRect.Width = gridSize.Width; 1864offset.Width = minControlSize.Width; 1922_mouseDragOffset.Width = x - _mouseDragBase.X; 1942_mouseDragOffset.Width += offset.X; 1950_mouseDragOffset.Width = -_mouseDragOffset.Width; 2041paintRect.Width++; // gpr: FillRectangle with a TextureBrush comes up one pixel short
System\Windows\Forms\Design\PictureBoxDesigner.cs (1)
53rc.Width--;
System\Windows\Forms\Design\SelectionUIHandler.cs (4)
76containerRect.Width = screen.Width; 107b.Width = bounds[i].Width; 373newBounds.Width = tempNewBounds.Width; 378newBounds.Width = tempNewBounds.Width;
System\Windows\Forms\Design\SelectionUIService.cs (5)
668_mouseDragOffset.Width = _mouseDragAnchor.X - screenCoord.X; 672_mouseDragOffset.Width = screenCoord.X - _mouseDragAnchor.X; 694delta.Width -= old.Width; 1082newOffset = offset with { Width = 0, Height = 0 }; 1086newOffset.Width = newOffset.Height = 0;
System\Windows\Forms\Design\SplitterDesigner.cs (1)
27rectangle.Width--;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
849rc.Width--;
System\Windows\Forms\Design\TabOrder.cs (1)
257convertedRectangle.Width = sz.Width + 2;
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
65r.Width++;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
162bounds.Width--;
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
242rc.Width--;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1814bounds.Width--;
1272 references to Width
PresentationUI (1)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (1)
1042cellBounds.X + (cellBounds.Width - boxSize.Width) / 2,
System.ComponentModel.TypeConverter (2)
System\Drawing\RectangleConverter.cs (2)
77intConverter.ConvertToString(context, culture, rect.Width), 90rect.X, rect.Y, rect.Width, rect.Height});
System.Drawing.Common.Tests (108)
mono\System.Imaging\MetafileTest.cs (2)
70Assert.Equal(3096, header.Bounds.Width); 193Assert.Equal(0, mh.Bounds.Width);
System\Drawing\BitmapTests.cs (4)
374Assert.Equal(rectangle.Width, clone.Width); 379for (int x = 0; x < rectangle.Width; x++) 410Assert.Equal(rectangle.Width, clone.Width); 1068Assert.Equal(rectangle.Width, data.Width);
System\Drawing\Imaging\ImageAttributesTests.cs (94)
70using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 77graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, clone); 94using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 99graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 103graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 147using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 152graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 157graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 171using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 179graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 183graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 187graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 202using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 210graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 273using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 281graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 298using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 308graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 312graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 316graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 342using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 348graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 365using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 371graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 392using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 398graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 421using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 427graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 482using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 487graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 495using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 500graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 508using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 513graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 537using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 543graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 551using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 557graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 581using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 586graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 594using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 599graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 607using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 612graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 638using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 645graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 669using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 676graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 684using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 692graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 717using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 726graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 734using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 743graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 751using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 760graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 785using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 792graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 800using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 807graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 815using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 821graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 848using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 855graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 863using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 870graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 904using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 910graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 930using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 936graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 960using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 966graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1009using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1016graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1024using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1031graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1056using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1062graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1122using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1130graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1138using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1146graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1171using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1176graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1184using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1189graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1197using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1202graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1248using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1254graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1262using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1268graphics.DrawImage(bitmap, _rectangle, _rectangle.X, _rectangle.Y, _rectangle.Width, _rectangle.Height, GraphicsUnit.Pixel, imageAttr); 1307using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height); 1322using Bitmap bitmap = new(_rectangle.Width, _rectangle.Height);
System\Drawing\RegionTests.cs (8)
1342Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height)); 1343Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height)); 1344Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, s_graphic)); 1345Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, disposedGraphics)); 1346Assert.Equal(expected, region.IsVisible(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, null)); 1347Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, s_graphic)); 1348Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, disposedGraphics)); 1349Assert.Equal(expected, region.IsVisible((float)rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, null));
System.Drawing.Primitives (18)
System\Drawing\Rectangle.cs (17)
74readonly get => new Size(Width, Height); 139public readonly int Right => unchecked(X + Width); 149/// Tests whether this <see cref='System.Drawing.Rectangle'/> has a <see cref='System.Drawing.Rectangle.Width'/> 167left.X == right.X && left.Y == right.Y && left.Width == right.Width && left.Height == right.Height; 223public readonly bool Contains(int x, int y) => X <= x && x < X + Width && Y <= y && y < Y + Height; 236(X <= rect.X) && (rect.X + rect.Width <= X + Width) && 239public override readonly int GetHashCode() => HashCode.Combine(X, Y, Width, Height); 280Width = result.Width; 291int x2 = Math.Min(a.X + a.Width, b.X + b.Width); 307(rect.X < X + Width) && (X < rect.X + rect.Width) && 316int x2 = Math.Max(a.X + a.Width, b.X + b.Width); 343public override readonly string ToString() => $"{{X={X},Y={Y},Width={Width},Height={Height}}}";
System\Drawing\RectangleF.cs (1)
323public static implicit operator RectangleF(Rectangle r) => new RectangleF(r.X, r.Y, r.Width, r.Height);
System.Private.Windows.Core (1)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
169value.Width,
System.Windows.Forms (824)
System\Windows\Forms\Accessibility\AccessibleObject.cs (3)
1062width = BoundingRectangle.Width 1700*pcxWidth = bounds.Width; 1713*pcxWidth = bounds.Width;
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (1)
201=> rect.IsEmpty || rect.Width <= 0 || rect.Height <= 0;
System\Windows\Forms\ActiveX\AxHost.cs (2)
1201if (oldBounds.X == x && oldBounds.Y == y && oldBounds.Width == width && oldBounds.Height == height) 1215if (width != oldBounds.Width || height != oldBounds.Height)
System\Windows\Forms\Control.cs (11)
1009set => SetBounds(value.X, value.Y, value.Width, value.Height, BoundsSpecified.All); 4903if (targetBounds.Width <= 0 || targetBounds.Height <= 0 4914int width = Math.Min(Width, targetBounds.Width); 5302int sw = bounds.Width; 5327int localWidth = bounds.Width - adornmentsBeforeDpiChange.Width; 8163e.Graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); 8231rectangle.Width, 10070width = adjustedBounds.Width; 11746if (doubleBuffered && (clip.Width <= 0 || clip.Height <= 0)) 12634if (sizeProperty is not null && !sizeProperty.IsReadOnly && (bounds.Width != Width || bounds.Height != Height)) 12662SetBoundsCore(bounds.X, bounds.Y, bounds.Width, bounds.Height, specified);
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1183ShowToolTip = (ClientRectangle.Width < preferredSize.Width || ClientRectangle.Height < preferredSize.Height);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (11)
137Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right 140Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right 192Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right 195Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right 240Point p1 = new(bounds.X + bounds.Width - 1, bounds.Y); // Upper inner right 243Point p4 = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); // Inner bottom right 330size = Math.Min(size, Math.Min(bounds.Width, bounds.Height)); 333Rectangle right = new(bounds.X + bounds.Width - size, bounds.Y, size, bounds.Height); 334Rectangle top = new(bounds.X + size, bounds.Y, bounds.Width - size * 2, size); 335Rectangle bottom = new(bounds.X + size, bounds.Y + bounds.Height - size, bounds.Width - size * 2, size); 438graphics.DrawRectangle(pen, r.X, r.Y, r.Width - 1, r.Height - 1);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (15)
283layout.TextBounds.Width + 2, 299if (layout.Focus.Width % 2 == 0) 374layout.CheckBounds.X = (field.X + field.Width) - layout.CheckBounds.Width; 378layout.CheckBounds.X = field.X + (field.Width - layout.CheckBounds.Width) / 2; 411layout.CheckArea.X = field.X + field.Width - checkSizeFull; 421layout.CheckArea.Width = field.Width; 432layout.CheckArea.Width = field.Width; 590Math.Min(layout.TextBounds.X, layout.Field.X + (layout.Field.Width - layout.TextBounds.Width) / 2), 600Math.Min(maxBounds.Width - layout.TextBounds.Width, layout.ImageBounds.Width)); 601layout.TextBounds.X = layout.ImageBounds.X + layout.ImageBounds.Width;
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (4)
173if (fullSize.Width == checkSize) 298&& cacheCheckImage.Width == fullSize.Width 307RECT rcCheck = new Rectangle(0, 0, fullSize.Width, fullSize.Height); 308Bitmap bitmap = new(fullSize.Width, fullSize.Height);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (2)
46layout.Focus.Width = layout.TextBounds.Width + layout.ImageBounds.Width - 1;
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
262=> rect.IsEmpty || rect.Width <= 0 || rect.Height <= 0;
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (12)
33_outerBorder = new Rectangle(_clientRect.Location, new Size(_clientRect.Width - 1, _clientRect.Height - 1)); 34_innerBorder = new Rectangle(_outerBorder.X + 1, _outerBorder.Y + 1, _outerBorder.Width - dropDownButtonWidth - 2, _outerBorder.Height - 2); 35_innerInnerBorder = new Rectangle(_innerBorder.X + 1, _innerBorder.Y + 1, _innerBorder.Width - 2, _innerBorder.Height - 2); 51_innerBorder.X = _clientRect.Width - _innerBorder.Right; 52_innerInnerBorder.X = _clientRect.Width - _innerInnerBorder.Right; 53_dropDownRect.X = _clientRect.Width - _dropDownRect.Right; 54_whiteFillRect.X = _clientRect.Width - _whiteFillRect.Right + 1; // since we're filling, we need to move over to the next px. 97new Rectangle(_outerBorder.X, _outerBorder.Y, _dropDownRect.Width + 1, _outerBorder.Height)); 125new Rectangle(_outerBorder.X, _outerBorder.Y, _dropDownRect.Width + 1, _outerBorder.Height)); 148Point middle = new(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2); 152middle.X -= (dropDownRect.Width % 2); 157middle.X += (dropDownRect.Width % 2);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (4)
470_vertScrollBar.Left = ClientRectangle.Width - _vertScrollBar.Width; 2462int displayWidth = _layout.Data.Width; 2675int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width; 2797if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width) <= 0)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (103)
540if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) > _layout.Data.Width) 548int availableWidth = _layout.Data.Width; // Width available for auto-filled columns 594int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 748int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 925Debug.Assert(_layout.Data.Width == _layout.Inside.Width - _layout.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0)); 926int availableWidth = _layout.Data.Width - imposedWidthSum; 940&& SystemInformation.VerticalScrollBarWidth <= _layout.Data.Width) 1757if (_layout.TopLeftHeader.Width > 0) 1760? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 1822if (_layout.TopLeftHeader.Width > 0) 1825? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 2015if (_layout.TopLeftHeader.Width > 0) 2177if (_layout.TopLeftHeader.Width > 0) 2432if (_layout.TopLeftHeader.Width > 0) 2463cursorClip.X += cursorClip.Width - frozenWidth; 2466cursorClip.Width = Math.Min(frozenWidth, _layout.Data.Width); 2475else if (_layout.Data.Width > frozenWidth + scrollingWidth) 2477cursorClip.X += _layout.Data.Width - frozenWidth - scrollingWidth; 2480cursorClip.Width = Math.Min(scrollingWidth, _layout.Data.Width); 2740if (_layout.TopLeftHeader.Width > 0) 2971if (_layout.TopLeftHeader.Width > 0) 2984r.X = Math.Min(r.X, inside.Right - r.Width); 2993r.X = Math.Min(inside.Right - r.Width, r.X); 3027inside.Width, 4216if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >= _layout.Data.Width) 4367newLayout.Inside = _normalClientRectangle.Width > 0 || _normalClientRectangle.Height > 0 4379if (inside.Width < 0) 4404rowHeaders.Width = Math.Min(RowHeadersWidth, rowHeaders.Width); 4407rowHeaders.X += insideLeft.Width - rowHeaders.Width; 4411insideLeft.X += rowHeaders.Width; 4414insideLeft.Width -= rowHeaders.Width; 4415Debug.Assert(insideLeft.Width >= 0); 4423topLeft.Width = Math.Min(RowHeadersWidth, topLeft.Width); 4424colHeaders.Width -= topLeft.Width; 4427topLeft.X += insideLeft.Width; 4431colHeaders.X += topLeft.Width; 4434Debug.Assert(colHeaders.Width >= 0); 4457if (insideLeft.Width > 0) 4478Debug.Assert(newLayout.Data.Width >= 0); 4570int displayWidth = _layout.Data.Width, cx = 0; 5524int cxMax = _layout.Data.Width, cx = 0; 5712PInvoke.PatBlt(dc, r.X, r.Y, r.Width, DATAGRIDVIEW_shadowEdgeThickness, ROP_CODE.PATINVERT); 5713PInvoke.PatBlt(dc, r.X, r.Y + r.Height - DATAGRIDVIEW_shadowEdgeThickness, r.Width, DATAGRIDVIEW_shadowEdgeThickness, ROP_CODE.PATINVERT); 5715PInvoke.PatBlt(dc, r.X + r.Width - DATAGRIDVIEW_shadowEdgeThickness, r.Y + DATAGRIDVIEW_shadowEdgeThickness, DATAGRIDVIEW_shadowEdgeThickness, r.Height - 2 * DATAGRIDVIEW_shadowEdgeThickness, ROP_CODE.PATINVERT); 5730PInvoke.PatBlt(dc, r.X, r.Y, r.Width, r.Height, ROP_CODE.PATINVERT); 8571int emptyBackgroundWidth = Math.Max(0, _layout.Data.Width - Columns.GetColumnsWidth(DataGridViewElementStates.Visible)); 9093Rectangle rowRect = new(data.X, cy, data.Width, displayHeight); 9097rowRect.Width += _layout.RowHeaders.Width; 9100rowRect.X -= _layout.RowHeaders.Width; 10020Invalidate(new Rectangle(data.X, top, data.Width, bottom - top)); 10174&& totalVisibleWidth > _layout.Data.Width 10175&& totalVisibleFrozenWidth < _layout.Data.Width 10182if (totalVisibleWidth - _layout.Data.Width <= vertScrollBarWidth 10183|| _layout.Data.Width - totalVisibleFrozenWidth <= vertScrollBarWidth) 10192needHorizScrollbar = totalVisibleFrozenWidth < _layout.Data.Width - vertScrollBarWidth; 10221&& vertScrollBarWidth <= _layout.Data.Width) 10224Debug.Assert(_layout.Data.Width >= 0); 10233Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10250&& totalVisibleWidth > _layout.Data.Width && totalVisibleFrozenWidth < _layout.Data.Width 10278&& vertScrollBarWidth <= _layout.Data.Width) 10281Debug.Assert(_layout.Data.Width >= 0); 10290Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10315int widthNotVisible = totalVisibleWidth - _layout.Data.Width; 10324rightToLeftInternal ? _layout.Inside.X + _layout.ResizeBoxRect.Width : _layout.Inside.X, 10326_layout.Inside.Width - _layout.ResizeBoxRect.Width, 14503if (rightArea.Width > 0 && rightArea.Height > 0) 14516if (rightArea.Width > 0 && rightArea.Height > 0) 16835edge.X += rect.Width - 1; 17448right = new Rectangle(oldClientRectangle.X + oldClientRectangle.Width - borderWidth, 17454oldClientRectangle.Width, 17467if (newClientRectangle.Width != oldClientRectangle.Width) 17470right = new Rectangle(newClientRectangle.X + newClientRectangle.Width - borderWidth, 17482newClientRectangle.Width, 17490right = new Rectangle(oldGridFocusRectangle.X + oldGridFocusRectangle.Width - 1, 17498oldGridFocusRectangle.Width, 19229if (rcBelowRows.Width > 0 && rcBelowRows.Height > 0) 19245rcNextRows.X += _layout.RowHeaders.Width; 19248rcNextRows.Width -= _layout.RowHeaders.Width; 19273if (rcNextRows.Width > 0 && rcNextRows.Height > 0) 19292Rectangle edge = new(0, 0, bounds.Width, borderWidth); 19309edge.X = bounds.Width - borderWidth; 19322g.DrawRectangle(pen, new Rectangle(0, 0, bounds.Width - 1, bounds.Height - 1)); 19332g.DrawRectangle(pen, new Rectangle(0, 0, bounds.Width - 1, bounds.Height - 1)); 19368Debug.Assert(cellBounds.Width > 0); 19369cellBounds.X = RightToLeftInternal ? bandBounds.Right - cx - cellBounds.Width : bandBounds.X + cx; 19399cx += cellBounds.Width; 19400if (cx >= bandBounds.Width) 19418if (DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0 && cx < scrollingBounds.Width) 19446Debug.Assert(cellBounds.Width > 0); 19448? scrollingBounds.Right - cx - cellBounds.Width 19473cx += cellBounds.Width; 19474if (cx >= scrollingBounds.Width) 19502if (_layout.TopLeftHeader.Width > 0 && (clipRect.IntersectsWith(_layout.TopLeftHeader) || _lastHeaderShadow != -1)) 19816if (editingZone.Width == 0 || editingZone.Height == 0) 19843editingZone.Width = Math.Max(0, editingZone.Width - totalVisibleFrozenWidth); 19859if (cellClip.Width == 0 || cellClip.Height == 0) 26381rowsRect.Width = _layout.RowHeaders.Width;
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (7)
294int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 310marginWidths = rectThemeMargins.X + rectThemeMargins.Width; 685if (valBounds.Height <= 0 || valBounds.Width <= 0) 713if (valBounds.Height > 0 && valBounds.Width > 0 && (paint || computeContentBounds)) 875Debug.Assert(valBounds.Height <= 0 || valBounds.Width <= 0); 884valBounds.Width > 2 * SystemInformation.Border3DSize.Width + 1 && 974if (valBounds.Width > 0 && valBounds.Height > 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (17)
1016if (cellValueBounds.Width >= IconMarginWidth * 2 + s_iconsWidth && 2759if (contentBounds.Width > 0) 2766contentBounds.Width, 3149if (dividerThickness > bounds.Width) 3151dividerThickness = bounds.Width; 3175if (bounds.Width <= 0) 3199bounds.X, bounds.Bottom - dividerThickness, bounds.Width, dividerThickness); 3539cellValueBounds.Width >= IconMarginWidth * 2 + s_iconsWidth && 3567cellValueBounds.Width >= IconMarginWidth * 2 + s_iconsWidth && 3571if (iconBounds.Width >= IconMarginWidth && iconBounds.Height >= s_iconsHeight) 3618rectPadding.Width = bounds.Width - cellStyle.Padding.Horizontal; 3774editingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height); 3810int xEditingPanel, wEditingPanel = cellBounds.Width; 3826if (cellClip.Right <= cellBounds.Right - borderAndPaddingWidths.Width) 3832wEditingPanel -= borderAndPaddingWidths.Width; 3836wEditingControl = cellBounds.Width - borderAndPaddingWidths.X - borderAndPaddingWidths.Width;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (1)
330int cellRight = columnRect.Left + columnRect.Width;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (7)
650int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 1199if (valBounds.Width >= checkBoxSize.Width && valBounds.Height >= checkBoxSize.Height && (paint || computeContentBounds)) 1211checkBoxX = valBounds.Left + (valBounds.Width - checkBoxSize.Width) / 2; 1340if (s_checkImage is null || s_checkImage.Width != fullSize.Width || s_checkImage.Height != fullSize.Height) 1350RECT rcCheck = new Rectangle(0, 0, fullSize.Width, fullSize.Height); 1351Bitmap bitmap = new(fullSize.Width, fullSize.Height); 1548Debug.Assert(valBounds.Width < checkBoxSize.Width || valBounds.Height < checkBoxSize.Height, "the bounds are empty");
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (17)
498int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 693preferredSize.Width += rectThemeMargins.X + rectThemeMargins.Width; 794if (paint && PaintBackground(paintParts) && backgroundBounds.Width > 0 && backgroundBounds.Height > 0) 831bmFlipXPThemes.Width < backgroundBounds.Width || bmFlipXPThemes.Width > 2 * backgroundBounds.Width || 834bmFlipXPThemes = FlipXPThemesBitmap = new Bitmap(backgroundBounds.Width, backgroundBounds.Height); 838DataGridViewColumnHeaderCellRenderer.DrawHeader(gFlip, new Rectangle(0, 0, backgroundBounds.Width, backgroundBounds.Height), state); 840g.DrawImage(bmFlipXPThemes, backgroundBounds, new Rectangle(bmFlipXPThemes.Width - backgroundBounds.Width, 0, backgroundBounds.Width, backgroundBounds.Height), GraphicsUnit.Pixel); 854valBounds.X += rectThemeMargins.Width; 855valBounds.Width -= rectThemeMargins.X + rectThemeMargins.Width; 860valBounds.Width -= rectThemeMargins.X + rectThemeMargins.Width; 865if (paint && PaintBackground(paintParts) && backgroundBounds.Width > 0 && backgroundBounds.Height > 0) 901if (valBounds.Width - HorizontalTextMarginLeft - HorizontalTextMarginRight > 0 && 921int width = valBounds.Width - 993valBounds.Width >= s_sortGlyphWidth + 2 * s_sortGlyphHorizontalMargin && 997sortGlyphLocation = new Point(valBounds.Left + (valBounds.Width - s_sortGlyphWidth) / 2,
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (31)
537Size adjustedSize = new(size.Width - borderAndPaddingWidths.X - borderAndPaddingWidths.Width, 562if (x >= size.Width - borderAndPaddingWidths.Width - dropWidth - 1 && 563x <= size.Width - borderAndPaddingWidths.Width - 1) 1177int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 1932if (paint && PaintBackground(paintParts) && !brushColor.HasTransparency() && valBounds.Width > 0 && valBounds.Height > 0) 1952if (paint && valBounds.Width > 0 && valBounds.Height > 0) 1958g.FillRectangle(brush!, valBounds.Left, valBounds.Top, valBounds.Width, valBounds.Height); 1974PaintBackground(paintParts) && !brushColor.HasTransparency() && valBounds.Width > 2 && valBounds.Height > 2) 1976g.FillRectangle(brush!, valBounds.Left + 1, valBounds.Top + 1, valBounds.Width - 2, valBounds.Height - 2); 1983g.DrawRectangle(SystemPens.ControlLightLight, new Rectangle(valBounds.X, valBounds.Y, valBounds.Width - 1, valBounds.Height - 1)); 1987g.FillRectangle(brush!, valBounds.Left, valBounds.Top, valBounds.Width, valBounds.Height); 1992int dropWidth = Math.Min(SystemInformation.HorizontalScrollBarThumbWidth, valBounds.Width - 2 * Margin - 1); 2096dropRect.X + dropRect.Width - 1, dropRect.Y); 2105valBounds.X + valBounds.Width - 1, valBounds.Y + valBounds.Height - 1); 2106g.DrawLine(pen, valBounds.X + valBounds.Width - 1, valBounds.Y, 2107valBounds.X + valBounds.Width - 1, valBounds.Y + valBounds.Height - 1); 2116dropRect.X + dropRect.Width - 1, dropRect.Y + dropRect.Height - 1); 2117g.DrawLine(pen, dropRect.X + dropRect.Width - 1, dropRect.Y, 2118dropRect.X + dropRect.Width - 1, dropRect.Y + dropRect.Height - 1); 2125valBounds.X + valBounds.Width - 2, valBounds.Y); 2135dropRect.X + dropRect.Width - 2, dropRect.Y + 1); 2145dropRect.X + dropRect.Width - 2, dropRect.Y + dropRect.Height - 2); 2146g.DrawLine(pen, dropRect.X + dropRect.Width - 2, dropRect.Y + 1, 2147dropRect.X + dropRect.Width - 2, dropRect.Y + dropRect.Height - 2); 2155Point middle = new(dropRect.Left + dropRect.Width / 2, dropRect.Top + dropRect.Height / 2); 2157middle.X += (dropRect.Width % 2); 2178Point middle = new(dropRect.Left + (dropRect.Width - 1) / 2, 2181middle.X += ((dropRect.Width + 1) % 2); 2245if (textBounds.Width > 1 && textBounds.Height > 1) 2275if (focusBounds.Width > 0 && focusBounds.Height > 0) 2313if (textBounds.Width > 0 && textBounds.Height > 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
394s_rectThemeMargins.Y + s_rectThemeMargins.Width + s_rectThemeMargins.Height == 0)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (15)
410int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 588if (imgWidth * bounds.Height < imgHeight * bounds.Width) 603bounds.Width, 604decimal.ToInt32((decimal)imgHeight * bounds.Width / imgWidth)); 616DataGridViewContentAlignment.TopLeft => bounds.Right - imageBounds.Width, 618DataGridViewContentAlignment.MiddleLeft => bounds.Right - imageBounds.Width, 620DataGridViewContentAlignment.BottomLeft => bounds.Right - imageBounds.Width, 628DataGridViewContentAlignment.TopRight => bounds.Right - imageBounds.Width, 630DataGridViewContentAlignment.MiddleRight => bounds.Right - imageBounds.Width, 632DataGridViewContentAlignment.BottomRight => bounds.Right - imageBounds.Width, 643imageBounds.X = bounds.X + (bounds.Width - imageBounds.Width) / 2; 750if (valBounds.Width <= 0 || valBounds.Height <= 0 || (!paint && !computeContentBounds)) 760Debug.Assert(valBounds.Height <= 0 || valBounds.Width <= 0); 785if (imageBounds.Width <= 0 || imageBounds.Height <= 0 || (icon is null && image is null))
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (4)
551int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 977if (valBounds.Width > 0 && valBounds.Height > 0) 1040errorBounds.Width > 0 && 1055valBounds.Width > 0 &&
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (11)
1523Debug.Assert(cellBounds.Width > 0); 1526cellBounds.X = rowBounds.Right - cx - cellBounds.Width; 1563cx += cellBounds.Width; 1564if (cx >= rowBounds.Width) 1576if (cx < dataBounds.Width) 1613Debug.Assert(cellBounds.Width > 0); 1616cellBounds.X = dataBounds.Right - cx - cellBounds.Width; 1653cx += cellBounds.Width; 1654if (cx >= dataBounds.Width) 1700Debug.Assert(cellBounds.Width > 0); 1703cellBounds.X = rowBounds.Right - cellBounds.Width;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (17)
530int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 542borderAndPaddingHeights += rectThemeMargins.Width; 673if (backgroundBounds.Width > 0 && backgroundBounds.Height > 0) 698using Bitmap bmFlipXPThemes = new(backgroundBounds.Height, backgroundBounds.Width); 700DataGridViewRowHeaderCellRenderer.DrawHeader(gFlip, new Rectangle(0, 0, backgroundBounds.Height, backgroundBounds.Width), state); 706new Rectangle(0, 0, backgroundBounds.Width, backgroundBounds.Height), 722valBounds.Height -= rectThemeMargins.X + rectThemeMargins.Width; 729if (valBounds.Width > 0 && valBounds.Height > 0) 760if (valBounds.Width > 0 && valBounds.Height > 0) 767if (valBounds.Width >= s_iconsWidth + 2 * RowHeaderIconMarginWidth 836Debug.Assert(valBounds.Width >= 0); 845if (valBounds.Width > 0 && valBounds.Height > 0) 848if (DataGridView.ShowRowErrors && valBounds.Width > s_iconsWidth + 2 * RowHeaderIconMarginWidth) 851Size maxBounds = new(valBounds.Width - s_iconsWidth - 2 * RowHeaderIconMarginWidth, valBounds.Height); 904if (errorBounds.Width >= 3 * RowHeaderIconMarginWidth + 2 * s_iconsWidth) 923if (valBounds.Width >= s_iconsWidth + 2 * RowHeaderIconMarginWidth && 987if (errorBounds.Width >= 3 * RowHeaderIconMarginWidth +
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (1)
38cellRect.X = rowRect.Right - cellRect.Width;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (10)
142int originalWidth = editingControlBounds.Width; 154editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 2); 159editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 1); 168editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - 3); 178editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight); 183editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight - 1); 403int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 679bool notCollapsed = valBounds.Width > 0 && valBounds.Height > 0; 727if (valBounds.Width > 0 && valBounds.Height > 0) 799DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (2)
146int borderAndPaddingWidths = borderWidthsRect.Left + borderWidthsRect.Width + cellStyle.Padding.Horizontal; 303if (valBounds.Width > 0 &&
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (5)
323if (sizeRequired.Width > cellBounds.Width) 329Size sizeCell = new(cellBounds.Width, cellBounds.Height); 397ptTextLocation.X = cellBounds.X + (cellBounds.Width - sizeText.Width) / 2; 412ptTextLocation.X = cellBounds.X + (cellBounds.Width - sizeText.Width) / 2; 427ptTextLocation.X = cellBounds.X + (cellBounds.Width - sizeText.Width) / 2;
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
1023int width = CommonProperties.GetSpecifiedBounds(this).Width;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (3)
486textSize = Size.Ceiling(graphics.MeasureString(Text, Font, textRectangle.Width, format)); 515textSize = hdc.HDC.MeasureText(Text, hfont, new Size(textRectangle.Width, int.MaxValue), (TextFormatFlags)flags); 537textLeft += textRectangle.Width - textSize.Width;
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (25)
185new Size(textBounds.Width, textBounds.Height), 194textBounds.X = bounds.Right - textBounds.Width - BoxHeaderWidth + 1; 218clipMiddle.Width = Math.Max(0, textBounds.Width - 3); // -3 to account for the margin built in the MeasureText result 222clipMiddle.X = clipLeft.Left - clipMiddle.Width; 257g.DrawLine(light, bounds.Left, bounds.Height - 1, bounds.Width - 1, bounds.Height - 1); 258g.DrawLine(dark, bounds.Left, bounds.Height - 2, bounds.Width - 1, bounds.Height - 2); 261g.DrawLine(light, bounds.Left + 1, bounds.Top + 1, bounds.Width - 1, bounds.Top + 1); 262g.DrawLine(dark, bounds.Left, bounds.Top, bounds.Width - 2, bounds.Top); 265g.DrawLine(light, bounds.Width - 1, bounds.Top, bounds.Width - 1, bounds.Height - 1); 266g.DrawLine(dark, bounds.Width - 2, bounds.Top, bounds.Width - 2, bounds.Height - 2); 288new Size(textBounds.Width, textBounds.Height), 296textBounds.X = bounds.Right - textBounds.Width - TextOffset; 306if (textBounds.Width > 0) 322bounds.Left, bounds.Height - 2, bounds.Width - 1, bounds.Height - 2, // Right 324textBounds.X + textBounds.Width + 2, boxTop - 1, bounds.Width - 2, boxTop - 1, // Top-right 325bounds.Width - 2, boxTop - 1, bounds.Width - 2, bounds.Height - 2 // Right 334bounds.Left, bounds.Height - 1, bounds.Width, bounds.Height - 1, // Right 336textBounds.X + textBounds.Width + 1, boxTop, bounds.Width - 1, boxTop, // Top-right 337bounds.Width - 1, boxTop, bounds.Width - 1, bounds.Height - 1 // Right
System\Windows\Forms\Controls\Labels\Label.cs (4)
882xLoc = (r.X + r.Width - 4) - pointImageSize.Width; 886xLoc = r.X + (r.Width - pointImageSize.Width) / 2; 1272Size preferredSize = GetPreferredSize(new Size(clientRect.Width, clientRect.Height)); 1273_showToolTip = (clientRect.Width < preferredSize.Width || clientRect.Height < preferredSize.Height);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (10)
378xLoc = clientRect.Right - textRect.Width; 382xLoc = (clientRect.Width - textRect.Width) / 2; 403if (textRect.Width > clientRect.Width) 406width = clientRect.Width; 410width = textRect.Width; 557Size clientSize = new(clientRectWithPadding.Width, clientRectWithPadding.Height); 987Size preferredSize = GetPreferredSize(new Size(clientRect.Width, clientRect.Height)); 988_showToolTip = clientRect.Width < preferredSize.Width || clientRect.Height < preferredSize.Height;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (5)
549box.X = bounds.X + bounds.Width - _idealCheckSize - _listItemStartPosition; 572bounds.Width - (_idealCheckSize + (_listItemStartPosition * 2)), 629textBounds.Width - BORDER_SIZE, 715e.Bounds.Width > 2 * BORDER_SIZE && e.Bounds.Height > 2 * BORDER_SIZE) 722bounds.Width - BORDER_SIZE,
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (2)
2357bounds.Width = MultiColumn ? Math.Max(ColumnWidth, bounds.Width) : Math.Max(MaxItemWidth, bounds.Width);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
77bounds.Width = visibleArea.Width;
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (3)
103_ => new Rectangle(point, new Size(itemBounds.Width, itemBounds.Height)), 114new Size(Math.Min(TextRenderer.MeasureText(item.Text, item.Font).Width, itemBounds.Width), 131return new Rectangle(point, new Size(Math.Min(textWidth, itemBounds.Width), itemBounds.Height));
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
45_owningItem.Bounds.Width,
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemListAccessibleObject.cs (1)
23_owningItem.Bounds.Width,
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (1)
51int width = bounds.Width;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1661if (width != oldBounds.Width)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (4)
360result.X += (result.Width - _image.Width) / 2; 367float ratio = Math.Min(ClientRectangle.Width / (float)imageSize.Width, ClientRectangle.Height / (float)imageSize.Height); 370result.X = (ClientRectangle.Width - result.Width) / 2;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (3)
1970if (rc.Width < rc.Height) 1972for (int i = 0; i < rc.Width; i++) 1981ControlPaint.DrawReversibleLine(new Point(rc.X, rc.Y + i), new Point(rc.X + rc.Width, rc.Y + i), targetControl.BackColor);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CategoryGridEntry.cs (2)
137g.DrawLine(topLinePen, rect.X - 1, rect.Y - 1, rect.Width + 2, rect.Y - 1); 154g.DrawLine(topLinePen, rect.X - 2, rect.Y - 1, rect.Width + 1, rect.Y - 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (13)
1543if (paintFullLabel && (neededWidth >= (rect.Width - (stringX + 2)))) 1561g.FillRectangle(backBrush, rect.X, rect.Y, rect.Width, rect.Height); 1573stringX, rect.Y, rect.Width - stringX - 1, rect.Height); 1576int maxSpace = Math.Min(rect.Width - stringX - 1, labelWidth + PropertyGridView.GdiPlusSpace); 1715using HBITMAP compatibleBitmap = PInvokeCore.CreateBitmap(rectangle.Width, rectangle.Height, (uint)planes, (uint)bitsPixel, lpBits: null); 1719compatibleDC.HDC.FillRectangle(new Rectangle(0, 0, rectangle.Width, rectangle.Height), brush); 1720explorerTreeRenderer.DrawBackground(compatibleDC, new Rectangle(0, 0, rectangle.Width, rectangle.Height), hwnd); 1756g.DrawRectangle(pen, outline.X, outline.Y, outline.Width - 1, outline.Height - 1); 1764outline.X + outline.Width - indent - 1, 1772outline.X + outline.Width / 2, 1774outline.X + outline.Width / 2, 1883if (textWidth >= rect.Width || HasMultipleLines(text)) 1908rect.Width - 4,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (5)
120if (!_lastClientRectangle.IsEmpty && currentClientRectangle.Width > _lastClientRectangle.Width) 123_lastClientRectangle.Width - 1, 125currentClientRectangle.Width - _lastClientRectangle.Width + 1,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (18)
457return new Point(point.X + (rect.Width / 2), point.Y + (rect.Height / 2)); 619return new Rectangle(pt.X, pt.Y, rect.Width, rect.Height); 895control.SetBounds(targetRectangle.X, targetRectangle.Y, targetRectangle.Width, targetRectangle.Height); 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)); 1968Size sizeWindow = new(rect.Width, rect.Height); 1973boundsScroll.X = sizeWindow.Width - boundsScroll.Width - 1; 3581if (!_lastClientRect.IsEmpty && newRect.Width > _lastClientRect.Width) 3583Rectangle rectInvalidate = new(_lastClientRect.Width - 1, 0, newRect.Width - _lastClientRect.Width + 1, _lastClientRect.Height); 3589Rectangle rectInvalidate = new(0, _lastClientRect.Height - 1, _lastClientRect.Width, newRect.Height - _lastClientRect.Height + 1); 3725DropDownListBox.Width = Math.Max(maxWidth, GetRectangle(row, RowValue).Width); 3791int overhang = toolTip.Location.X + toolTip.Size.Width - SystemInformation.VirtualScreen.Width; 3965if (entry.OutlineRectangle.Height != outlineRectIconSize || entry.OutlineRectangle.Width != outlineRectIconSize) 4326rect.X + rect.Width - sizeBtn.Width, rect.Y,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (2)
456if ((_dragBaseRect.Width - delta) > s_minDropDownSize.Width) 459newBounds.Width = _dragBaseRect.Width - delta;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.GridViewTextBox.cs (1)
174ClientRectangle.Width <= PropertyGridView.SelectedGridEntry.GetValueTextWidth(Text, graphics, Font))
System\Windows\Forms\Controls\Splitter\Splitter.cs (9)
413bounds.X += bounds.Width - _splitSize; 420OnSplitterMoved(new SplitterEventArgs(Left, Top, (Left + bounds.Width / 2), (Top + bounds.Height / 2))); 579if (r.Width < minWeight) 587if (r.Width < minWeight) 592r.X = bounds.X + bounds.Width - splitSize - r.Width; 614DockStyle.Left or DockStyle.Right => r.Width, 633_initTargetSize = target.Bounds.Width; 702PInvoke.PatBlt(dc, r.X, r.Y, r.Width, r.Height, ROP_CODE.PATINVERT);
System\Windows\Forms\Controls\TabControl\TabPage.cs (2)
619inflateRect.Width + 8, 736base.SetBoundsCore(r.X, r.Y, r.Width, r.Height, specified == BoundsSpecified.None ? BoundsSpecified.None : BoundsSpecified.All);
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
396=> rect.IsEmpty || rect.Width <= 0 || rect.Height <= 0;
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (2)
410else if (item.Bounds.Width == 1) 551TableLayoutSettings.ColumnStyles[0].Width = Math.Max(0, DisplayRectangle.Width);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (7)
201CommonProperties.UpdateSpecifiedBounds(this, bounds.X, bounds.Y, bounds.Width, bounds.Height, BoundsSpecified.Location); 2311maxSize.Width += overflowItemMargin.Horizontal + overflowItem.Bounds.Width; 2651using Bitmap image = new(bounds.Width, bounds.Height); 2667bounds.Width, 4182gripRectangle.X = ClientRectangle.Right - gripRectangle.Width - Grip.Margin.Horizontal; 4195gripRectangle.Width = displayRect.Width; 4657SetBoundsCore(bounds.X, bounds.Y, bounds.Width, bounds.Height, specified);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs (2)
142Point middle = new(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2); 145middle.X += (dropDownRect.Width % 2);
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (3)
43CommonProperties.UpdateSpecifiedBounds(c, bounds.X, bounds.Y, bounds.Width, bounds.Height); 364CommonProperties.UpdateSpecifiedBounds(_control, specifiedBounds.X, specifiedBounds.Y, specifiedBounds.Width, specifiedBounds.Height); 375CommonProperties.UpdateSpecifiedBounds(_control, bounds.X, bounds.Y, bounds.Width, bounds.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (5)
1028offset.X = -dropDownBounds.Width; 1039offset.X = -dropDownBounds.Width; 1202SetBoundsCore(bounds.X, bounds.Y, bounds.Width, bounds.Height, BoundsSpecified.Location); 1528base.SetBoundsCore(bounds.X, bounds.Y, bounds.Width, bounds.Height, specified); 1765if (bounds.Width > 0 && bounds.Height > 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (2)
38preferredSize.Width += DropDownArrowRect.Width + _dropDownArrowPadding.Horizontal; 82_dropDownArrowRect = new Rectangle(0, options.Client.Bottom + _dropDownArrowPadding.Top, _ownerItem.Bounds.Width - 1, s_dropDownArrowSize.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (8)
145if (intersectionBetweenChildAndParent.Width >= 2) 151int newIntersectionWidth = Rectangle.Intersect(GetDropDownBounds(newDropDownDirection), ownerItemBounds).Width; 152if (newIntersectionWidth < intersectionBetweenChildAndParent.Width) 307offset.X = -dropDownBounds.Width + Width; 317offset.X = -dropDownBounds.Width + Width; 331offset.X = -dropDownBounds.Width; 391if (Rectangle.Intersect(dropDownBounds, itemScreenBounds).Width > 1) 397if (Rectangle.Intersect(dropDownBounds, itemScreenBounds).Width > 1)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (3)
77int padding = (ShowCheckMargin || ShowImageMargin) ? textPadding + ImageMargin.Width : textPadding; 326maxNonMenuItemSize.Width = Math.Max(item.Bounds.Width, maxNonMenuItemSize.Width); 432int trimPadding = _imageMarginBounds.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (18)
60int height = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Height : bounds.Width; 61int width = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Width : bounds.Height; 144g.DrawRectangle(SystemPens.ButtonHighlight, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 190g.DrawRectangle(SystemPens.ControlLight, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 263g.DrawRectangle(SystemPens.ButtonHighlight, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 277g.DrawRectangle(SystemPens.ButtonShadow, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 297bool oddWidth = ((bounds.Width & 0x1) == 0x1); 302g.DrawLine(p, bounds.X + indent, bounds.Y, bounds.Width - 1, bounds.Y); 304g.DrawLine(p, bounds.X + indent, bounds.Height - 1, bounds.Width - 1, bounds.Height - 1); 309g.DrawLine(p, bounds.Width - 1, bounds.Y + indent, bounds.Width - 1, bounds.Height - 1); 319g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.Width - 2, 1, 1, 1)); 333g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.Width - 2, bounds.Height - 2, 1, 1)); 360int startX = bounds.Width / 2; 367if (bounds.Width >= 4) 420g.DrawRectangle(SystemPens.ControlLight, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 452g.DrawRectangle(SystemPens.ControlLight, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 512g.DrawImage(image, imageRect, 0, 0, imageRect.Width, imageRect.Height, GraphicsUnit.Pixel, attrs);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
953SetBounds(currentBounds.X, currentBounds.Y, currentBounds.Width, value); 2006get => Bounds.Width; 3497return toolStripItemPlacement != ToolStripItemPlacement.Main || bounds.Height <= 0 || bounds.Width <= 0;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
985if (checkRectangle.Width != 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
77SetBoundsCore(bounds.X, bounds.Y, bounds.Width, bounds.Height, specified);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (4)
529controlLocations[j] = new Point(row.Bounds.Width - control.Right, control.Top); 958cursorLoc.X += toolStripToDrag.GripRectangle.Width / 2; 1024if (Orientation == Orientation.Horizontal && (bounds.Width == 0)) 1026bounds.Width = ParentInternal.DisplayRectangle.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (2)
274constrainingSize.Width = ToolStripPanelRow.Bounds.Width; 315if (spaceToFree > 0 && bounds.Width > spaceToFree)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (5)
464if (cachedBounds.Width > minSize.Width) 466spaceToFree -= (cachedBounds.Width - minSize.Width); 475cellOffsets[j] += Math.Max(0, currentCell.CachedBounds.Width - cachedBounds.Width); 676preferredSize.Width = DisplayRectangle.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (5)
35displayRect.Width = ToolStripPanel.ParentInternal.DisplayRectangle.Width - (ToolStripPanel.Margin.Horizontal + ToolStripPanel.Padding.Horizontal) - Row.Margin.Horizontal; 39displayRect.Width = raftingDisplayRectangle.Width - Row.Margin.Horizontal; 92return totalSize.Width < DisplayRectangle.Width; 290freedSpace += DisplayRectangle.Width; 363int spaceOccupiedByCell = cell.Margin.Horizontal + cell.Bounds.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (3)
58int x = previousRowBounds.X + previousRowBounds.Width - (previousRowBounds.Width >> 2); 68dragBounds.Width += (nextRowBounds.Width >> 2) + Row.Margin.Right + ToolStripPanel.RowsInternal[index + 1].Margin.Left;
System\Windows\Forms\Controls\ToolStrips\ToolStripProfessionalLowResolutionRenderer.cs (7)
62bool oddWidth = ((bounds.Width & 0x1) == 0x1); 67g.DrawLine(p, bounds.X + indent, bounds.Y, bounds.Width - 1, bounds.Y); 69g.DrawLine(p, bounds.X + indent, bounds.Height - 1, bounds.Width - 1, bounds.Height - 1); 74g.DrawLine(p, bounds.Width - 1, bounds.Y + indent, bounds.Width - 1, bounds.Height - 1); 84g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.Width - 2, 1, 1, 1)); 98g.FillRectangle(SystemBrushes.ButtonShadow, new Rectangle(bounds.Width - 2, bounds.Height - 2, 1, 1));
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (40)
374g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 388g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 429g.DrawLine(pen, bounds.Width - 2, bounds.Height - 2, bounds.Width - 1, bounds.Height - 3); 435g.DrawLine(pen, bounds.Width - 1, 0, bounds.Width - 1, bounds.Height - 1); 439g.DrawLine(pen, bounds.Width - 2, bounds.Height - 2, bounds.Width - 1, bounds.Height - 3); 457edging = new Rectangle(bounds.Width - 1, 3, 1, bounds.Height - 3); 461edging = new Rectangle(3, bounds.Height - 1, bounds.Width - 3, bounds.Height - 1); 488int height = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Height : bounds.Width; 489int width = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Width : bounds.Height; 548if ((bounds.Width == 0) || (bounds.Height == 0)) 588g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 645g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 663g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 854Point topRight = new(bounds.Width - 1, 0); 856Point bottomRight = new(bounds.Width - 1, bounds.Height - 1); 955if ((bounds.Width == 0) || (bounds.Height == 0)) 973endGradient.X = bounds.Right - endGradient.Width; 974useDoubleGradient = (bounds.Width > (firstGradientWidth + secondGradientWidth)); 1049e.ImageRectangle.Width + 4, e.ImageRectangle.Height + 2) 1050: new Rectangle(e.ImageRectangle.Left - 2, 1, e.ImageRectangle.Width + 4, e.Item.Height - 2); 1062g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 1075g.DrawRectangle(SystemPens.Highlight, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 1081if ((bounds.Width == 0) || (bounds.Height == 0)) 1096g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 1199g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 1226overflowBoundsFill.X += overflowBoundsFill.Width - _overflowButtonWidth + 1; 1312g.FillRectangle(brush, overflowBoundsFill.Width - 3, overflowBoundsFill.Top - 1, 1, 1); 1313g.FillRectangle(brush, overflowBoundsFill.Width - 2, overflowBoundsFill.Top - 2, 1, 1); 1345Point topRight = new(bounds.Width - 1, 0); 1406if ((bounds.Width == 0) || (bounds.Height == 0)) 1430if ((bounds.Width == 0) || (bounds.Height == 0)) 1510int startX = bounds.Width / 2; 1522if (isHorizontalSeparatorNotOnDropDownMenu && bounds.Width >= 4) 1542if ((bounds.Width == 0) || (bounds.Height == 0)) 1596g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 1648Point middle = new(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2); 1651middle.X += dropDownRect.Width % 2;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (5)
618Point middle = new(dropDownRect.Left + dropDownRect.Width / 2, dropDownRect.Top + dropDownRect.Height / 2); 845e.Graphics.DrawImage(image, imageRect, 0, 0, imageRect.Width, 874if (e.TextDirection != ToolStripTextDirection.Horizontal && textRect.Width > 0 && textRect.Height > 0) 985baseRect.X = sizeGripBounds.Width - baseRect.X - baseRect.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderEventArgs.cs (1)
125return new Rectangle(itemBounds.X + 1, 0, itemBounds.Width - 2, 2);
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
268return new Size(parent.Width - (parent.Padding.Horizontal - dropDownMenu.ImageMargin.Width), SeparatorThickness);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (1)
304int splitButtonButtonWidth = Math.Max(0, Width - dropDownButtonBounds.Width);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (1)
208int widthUnit = orig.Width / 2;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (6)
92if (currentWidth > _displayRectangle.Width - overflowWidth) 94int spaceRecovered = SendNextItemToOverflow((currentWidth + overflowWidth) - _displayRectangle.Width, true); 325else if (alignedRightItems.Width > 0 && alignedLeftItems.Width > 0 && alignedRightItems.IntersectsWith(alignedLeftItems)) 458else if (alignedRightItems.Width > 0 && alignedLeftItems.Width > 0 && alignedRightItems.IntersectsWith(alignedLeftItems))
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (8)
262e.Graphics.DrawLine(SystemPens.ButtonHighlight, 0, bounds.Bottom - 1, bounds.Width, bounds.Bottom - 1); 263e.Graphics.DrawLine(SystemPens.InactiveBorder, 0, bounds.Bottom - 2, bounds.Width, bounds.Bottom - 2); 267e.Graphics.DrawLine(SystemPens.ButtonHighlight, 0, bounds.Bottom - 1, bounds.Width, bounds.Bottom - 1); 268e.Graphics.DrawLine(SystemPens.ButtonShadow, 0, bounds.Bottom - 2, bounds.Width, bounds.Bottom - 2); 317if (bounds.Width >= 4) 467g.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 718int startX = bounds.Width / 2; 728if (bounds.Width >= 4)
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.cs (1)
93return new Size(bounds.Width, TextBox.PreferredHeight);
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
394SetBounds(r.X, r.Y, r.Height, r.Width, BoundsSpecified.All);
System\Windows\Forms\Controls\TrackBar\TrackBarRenderer.cs (5)
110if (numTicks <= 0 || bounds.Height <= 0 || bounds.Width <= 0 || g is null) 124float inc = ((float)bounds.Width - LineWidth) / ((float)numTicks - 1); 140if (numTicks <= 0 || bounds.Height <= 0 || bounds.Width <= 0 || g is null) 150t_visualStyleRenderer.DrawEdge(g, new Rectangle(bounds.X, bounds.Y, bounds.Width, LineWidth), Edges.Top, edgeStyle, EdgeEffects.None); 160t_visualStyleRenderer.DrawEdge(g, new Rectangle(bounds.X, (int)Math.Round(y), bounds.Width, LineWidth), Edges.Top, edgeStyle, EdgeEffects.None);
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (4)
532Rectangle clipTop = new(bounds.Left, bounds.Top, bounds.Width, border); 534Rectangle clipBottom = new(bounds.Left, bounds.Bottom - border, bounds.Width, border); 838int totalClientWidth = clientArea.Width; 850upDownEditBounds.Size = new Size(clientArea.Width - _defaultButtonsWidth, clientArea.Height);
System\Windows\Forms\Design\ComponentEditorForm.cs (4)
239pageHostBounds.Width, STRIP_HEIGHT); 243Rectangle pageBounds = new(0, 0, pageHostBounds.Width, pageHostBounds.Height); 253Size size = new(bounds.Width + 3 * (BUTTON_PAD + xFrame) + selectorWidth, 261bounds.X = bounds.Width + bounds.X - BUTTON_WIDTH;
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (1)
98int x = screen.X + (screen.Width - r.right + r.left) / 2;
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (4)
160_windowBounds.Width, 178PInvoke.SetViewportOrgEx(hdc, originalOrigin.X + _windowBounds.Width - 1, originalOrigin.Y, lppt: null); 201bounds.Width, bounds.Height); 389_windowBounds.Width,
System\Windows\Forms\Form.cs (11)
907SetDesktopBounds(value.X, value.Y, value.Width, value.Height); 1671if (_restoreBounds.Width == -1 3652cp.X = Math.Max(clientRect.X, clientRect.X + (clientRect.Width - cp.Width) / 2); 3677cp.X = Math.Max(screenRect.X, screenRect.X + (screenRect.Width - cp.Width) / 2); 3865else if (p.X + s.Width > screenRect.X + screenRect.Width) 3867p.X = screenRect.X + screenRect.Width - s.Width; 3914p.X = Math.Max(screenRect.X, screenRect.X + (screenRect.Width - Width) / 2); 4480_dpiFormSizes.Add(e.DeviceDpiNew, new Size(e.SuggestedRectangle.Width, e.SuggestedRectangle.Height)); 5011_formStateEx[s_formStateExWindowBoundsWidthIsClientSize] == 1 ? restoredSize.Width : _restoredWindowBounds.Width, 5214if ((specified & BoundsSpecified.Width) != 0 || _restoreBounds.Width == -1) 6820mmi->ptMaxSize.X = maximizedBounds.Width;
System\Windows\Forms\Input\Cursor.cs (2)
274imageWidth = imageRect.Width; 287targetWidth = targetRect.Width;
System\Windows\Forms\Internal\WinFormsUtils.cs (3)
82bounds.Size = new Size(Math.Min(constrainingBounds.Width - 2, bounds.Width), 91bounds.X = constrainingBounds.Right - bounds.Width;
System\Windows\Forms\Layout\CommonProperties.cs (3)
207bounds.Width = Math.Min(bounds.Width, value.Width); 231bounds.Width = Math.Max(bounds.Width, value.Width); 292bool wChangedButNotSpecified = ((specified & BoundsSpecified.Width) == BoundsSpecified.None) & width != originalBounds.Width;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (2)
1384float xScaleFactor = (float)suggestedRectangle.Width / Width; 1420suggestedRectangle.Width,
System\Windows\Forms\Layout\Containers\SplitContainer.cs (6)
718OnSplitterMoved(new SplitterEventArgs(SplitterRectangle.X + SplitterRectangle.Width / 2, SplitterRectangle.Y + SplitterRectangle.Height / 2, SplitterRectangle.X, SplitterRectangle.Y)); 991SplitterCancelEventArgs se = new(Left + SplitterRectangle.X + SplitterRectangle.Width / 2, Top + SplitterRectangle.Y + SplitterRectangle.Height / 2, xSplit, ySplit); 1381if (r.Width < minWeight) 1400if (r.Width < minWeight) 1478PInvoke.PatBlt(dc, r.X, r.Y, r.Width, r.Height, ROP_CODE.PATINVERT); 2285return new Rectangle(containerRectangle.X + splitterRectangle.X, containerRectangle.Y + splitterRectangle.Y, splitterRectangle.Width, splitterRectangle.Height);
System\Windows\Forms\Layout\DefaultLayout.cs (33)
38proposedConstraints.Width = bounds.Width; 57if (bounds.Width < prefSize.Width || bounds.Height < prefSize.Height) 83Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || (newSize.Height >= oldBounds.Height && newSize.Width >= oldBounds.Width), 89location.X -= newSize.Width - oldBounds.Width; 171int width = bounds.Width; 185width = displayRectangle.Width - (anchorInfo.Right + anchorInfo.Left); 194anchorInfo.Left = displayRectangle.Width - width - anchorInfo.Right; 200int growOrShrink = (displayRectangle.Width - (anchorInfo.Left + anchorInfo.Right + width)) / 2; 249right += displayRect.Width; 253left += displayRect.Width; 258int center = displayRect.Width / 2; 301if (right < left || cachedBounds.Width != element.Bounds.Width || cachedBounds.X != element.Bounds.X) 308right = left + Math.Max(element.Bounds.Width, cachedBounds.Width) + Math.Abs(right); 352if (CommonProperties.GetAutoSize(container) && ((displayRectangle.Width == 0) || (displayRectangle.Height == 0))) 431remainingBounds.X += element.Bounds.Width; 432remainingBounds.Width -= element.Bounds.Width; 444remainingBounds.Width -= element.Bounds.Width; 488Math.Max(0, newElementBounds.Width - remainingBounds.Width), 528(newElementBounds.Width < 0 || element.Bounds.Width == newElementBounds.Width) && 748int parentWidth = parentDisplayRect.Width; 768anchorInfo.Left = oldAnchorInfo.Right - cachedBounds.Width; 885anchorInfo.Right = displayRectangle.Width - (x + elementBounds.Width); 989widthFactor = ((double)displayRect.Width) / anchorInfo.DisplayRectangle.Width; 1028if ((displayRectangle.Width == 0) || (displayRectangle.Height == 0)) 1152prefSize.Width = anchorDest.Width < 0 1153? Math.Max(prefSize.Width, elementSpace.Right + anchorDest.Width)
System\Windows\Forms\Layout\FlowLayout.ContainerProxy.cs (1)
137newBounds.X = DisplayRect.Right - bounds.X - bounds.Width + ElementProxy.Margin.Left - ElementProxy.Margin.Right;
System\Windows\Forms\Layout\FlowLayout.cs (6)
76Rectangle measureBounds = new(displayRect.X, displayRect.Y, displayRect.Width, displayRect.Height - layoutSize.Height); 192elementConstraints.Width = rowBounds.Width - rowSize.Width - elementProxy.Margin.Size.Width; 326Debug.Assert(container.Children[0].Bounds.X == container.DisplayRectangle.X + container.DisplayRectangle.Width - container.Children[0].Bounds.Width - margin.Right); 348Debug.Assert(collection[i].Bounds.X + collection[i].Bounds.Width <= container.DisplayRectangle.X + container.DisplayRectangle.Width);
System\Windows\Forms\Layout\LayoutUtils.cs (15)
226if (rect1.X <= rect2.X && rect1.X + rect1.Width >= rect2.X + rect2.Width) 232if (rect2.X <= rect1.X && rect2.X + rect2.Width >= rect1.X + rect1.Width) 248if (rect1.Y <= rect2.Y && rect1.Y + rect1.Width >= rect2.Y + rect2.Width) 254if (rect2.Y <= rect1.Y && rect2.Y + rect2.Width >= rect1.Y + rect1.Width) 294withinThis.X += withinThis.Width - alignThis.Width; 298withinThis.X += (withinThis.Width - alignThis.Width) / 2; 310withinThis.X += withinThis.Width - alignThis.Width; 314withinThis.X += (withinThis.Width - alignThis.Width) / 2; 490return (rectangle.Width == 0 || rectangle.Height == 0); 514region1.X += bounds.Width - specifiedContent.Width; 603bounds.X = withinBounds.Width - bounds.Right;
System\Windows\Forms\Layout\TableLayout.cs (3)
1263cellBounds.Width = Math.Max(cellBounds.Width, 1); 1272elementBounds.Width = Math.Min(cellBounds.Width, elementBounds.Width);
System\Windows\Forms\MDI\MDIClient.cs (3)
197int sw = (int)Math.Round((bounds.X + bounds.Width) * dx - sx); 290using RegionScope rgn1 = new(0, 0, bounds.Width, bounds.Height); 294bounds.Width - rect.right,
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (6)
389outsideCellBounds.Width - (cellBorderWidth + 1) / 2, 435displayRect.Width - cellBorderWidth, 453tableBounds.X + tableBounds.Width - 1, 460tableBounds.X + tableBounds.Width - 1, 462tableBounds.X + tableBounds.Width - 1, 468tableBounds.X + tableBounds.Width - 1,
System\Windows\Forms\Printing\PrintPreviewControl.cs (5)
422internal double HorizontalViewSize => InsideRectangle.Width * 100.0 / VirtualSize.Width; 430rect.Width = Math.Max(0, rect.Width - 1); 626Math.Max(0, (rect.Width - _virtualSize.Width) / 2), 802_hScrollBar.Width = availableRect.Width - (verticalScrollNeeded ? _vScrollBar.Width : 0); 807displayDimension: availableRect.Width,
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
1143Rectangle rect = new(0, 0, item.Bounds.Width - 1, item.Bounds.Height - 1);
System\Windows\Forms\Rendering\ControlPaint.cs (82)
87if (bounds.Width > result.Width) 89result.X = (bounds.Width - result.Width) / 2; 100float xRatio = bounds.Width / (float)imageSize.Width; 105result.Width = bounds.Width; 125result.X = (bounds.Width - result.Width) / 2; 452imageRectangle.X += clipRect.Width - imageRectangle.Width; 482partOfImageToDraw.Width, 499partOfImageToDraw.Width, 626topLineRights[i] = bounds.X + bounds.Width - rightOffset - 1; 671bottomLineRights[i] = bounds.X + bounds.Width - rightOffset - 1; 917bounds.X + bounds.Width - 1 - i, 919bounds.X + bounds.Width - 1 - i, 937bounds.X + bounds.Width - 1 - i, 939bounds.X + bounds.Width - 1 - i, 962bounds.X + bounds.Width - 1 - i, 964bounds.X + bounds.Width - 1 - i, 979rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, 989rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, 998=> DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style, sides); 1066graphics.DrawLine(darkPen, bounds.X, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y); 1073bounds.X, bounds.Y + bounds.Height - 1, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); 1076bounds.X + bounds.Width - 1, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); 1080graphics.DrawLine(mediumPen, bounds.X + 1, bounds.Y + 1, bounds.X + bounds.Width - 2, bounds.Y + 1); 1089bounds.X + 1, bounds.Y + bounds.Height - 2, bounds.X + bounds.Width - 2, bounds.Y + bounds.Height - 2); 1092bounds.X + bounds.Width - 2, bounds.Y + 1, bounds.X + bounds.Width - 2, bounds.Y + bounds.Height - 2); 1105graphics.DrawLine(lightPen, bounds.X, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y); 1113bounds.X, bounds.Y + bounds.Height - 1, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); 1116bounds.X + bounds.Width - 1, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1); 1125graphics.DrawLine(topLeftPen, bounds.X + 1, bounds.Y + 1, bounds.X + bounds.Width - 2, bounds.Y + 1); 1133bounds.X + 1, bounds.Y + bounds.Height - 2, bounds.X + bounds.Width - 2, bounds.Y + bounds.Height - 2); 1136bounds.X + bounds.Width - 2, bounds.Y + 1, bounds.X + bounds.Width - 2, bounds.Y + bounds.Height - 2); 1151bounds = new Rectangle(bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 1180=> DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1205rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, 1228=> DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1256=> DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1280graphics.FillRectangle(brush, bounds.Left + 1, bounds.Top + 1, bounds.Width - 2, bounds.Height - 2); 1288int midx = bounds.X + bounds.Width / 2; 1345if (rectangle.Width < 0 || rectangle.Height < 0) 1351rectangle.Width - 2, 1360if (t_checkImage is null || t_checkImage.Width != rectangle.Width || t_checkImage.Height != rectangle.Height) 1370Bitmap bitmap = new(rectangle.Width, rectangle.Height); 1390graphics.DrawRectangle(pen, offsetRectangle.X, offsetRectangle.Y, offsetRectangle.Width - 1, offsetRectangle.Height - 1); 1498rectangle.Width - 1, 1675Point start = new(bounds.X + bounds.Width - 1, bounds.Y - 1); 1676Point end = new(bounds.X + bounds.Width - 1, bounds.Y + bounds.Height); 1689graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); 1691graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); 1695graphics.DrawRectangle(pen, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); 1702=> DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph); 1715rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, 1747=> DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1764=> DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1846=> DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state); 1888=> DrawSizeGrip(graphics, backColor, bounds.X, bounds.Y, bounds.Width, bounds.Height); 2053PInvoke.PatBlt(desktopDC, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, rop3); 2368g.DrawLine(SystemPens.Window, bound.X, bound.Y, bound.X + bound.Width - 1, bound.Y); 2370g.DrawLine(SystemPens.ControlDark, bound.X + bound.Width - 1, bound.Y, bound.X + bound.Width - 1, bound.Y + bound.Height - 1); 2371g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y + bound.Height - 1, bound.X + bound.Width - 1, bound.Y + bound.Height - 1); 2378bound = new Rectangle(bound.X + 1, bound.Y + 1, bound.Width - 1, bound.Height - 1); 2379g.DrawLine(SystemPens.Window, bound.X, bound.Y, bound.X + bound.Width - 1, bound.Y); 2382g.DrawLine(SystemPens.ControlDark, bound.X + bound.Width - 1, bound.Y, bound.X + bound.Width - 1, bound.Y + bound.Height - 1); 2383g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y + bound.Height - 1, bound.X + bound.Width - 1, bound.Y + bound.Height - 1); 2387g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y, bound.X + bound.Width - 1, bound.Y); 2389g.DrawLine(SystemPens.Window, bound.X + bound.Width - 1, bound.Y, bound.X + bound.Width - 1, bound.Y + bound.Height - 1); 2390g.DrawLine(SystemPens.Window, bound.X, bound.Y + bound.Height - 1, bound.X + bound.Width - 1, bound.Y + bound.Height - 1); 2398bound = new Rectangle(bound.X + 1, bound.Y + 1, bound.Width - 1, bound.Height - 1); 2399g.DrawLine(SystemPens.ControlDark, bound.X, bound.Y, bound.X + bound.Width - 1, bound.Y); 2401g.DrawLine(SystemPens.Window, bound.X + bound.Width - 1, bound.Y, bound.X + bound.Width - 1, bound.Y + bound.Height - 1); 2402g.DrawLine(SystemPens.Window, bound.X, bound.Y + bound.Height - 1, bound.X + bound.Width - 1, bound.Y + bound.Height - 1);
System\Windows\Forms\Rendering\TextExtensions.cs (1)
86if (bounds.Width == int.MaxValue)
System\Windows\Forms\Scrolling\HScrollProperties.cs (1)
15private protected override int GetPageSize(ScrollableControl parent) => parent.ClientRectangle.Width;
System\Windows\Forms\Scrolling\ScrollableControl.cs (24)
201rect.Width = _displayRect.Width; 223displayRectangle.Width = Math.Max(displayRectangle.Width, AutoScrollMinSize.Width); 292display.Width = client.Width; 332int maxX = minClient.Width; 461int ctlRight = -display.X + bounds.X + bounds.Width + _scrollMargin.Width; 490if (maxX <= fullClient.Width) 516if (needVscroll && maxX > clientToBe.Width) 523maxX = clientToBe.Width; 565_displayRect = new Rectangle(_displayRect.X, _displayRect.Y, _displayRect.Width, VerticalScroll.Maximum); 634int maxPos = -(client.Width - _displayRect.Width); 755int minX = Math.Min(client.Width - displayRectangle.Width, 0); 835&& (client.Width > 0 && client.Height > 0)) 875else if (bounds.X + bounds.Width + xMargin > client.Width) 877xCalc = client.Width - (bounds.X + bounds.Width + xMargin - _displayRect.X); 1049if (_displayRect.Width != width || _displayRect.Height != height) 1056int minX = ClientRectangle.Width - width; 1158HorizontalScroll._maximum = displayRect.Width - 1; 1163HorizontalScroll._largeChange = ClientRectangle.Width; 1364int maxPos = -(client.Width - _displayRect.Width);
System\Windows\Forms\ToolTip\ToolTip.cs (8)
1550int centeredX = toolRectangle.Left + toolRectangle.Width / 2 - width / 2; // tooltip will be aligned with tool vertically 1575locationWeights[i] += Math.Abs((long)intersection.Width * intersection.Height); // Intersection is a weight 1588locationClippedAreas[i] = (Math.Abs((long)possibleLocations[i].Width) - Math.Abs((long)locationAreaWithinScreen.Width)) 1603locationWithinTopControlAreas[i] = Math.Abs((long)locationWithinTopControlRectangle.Height * locationWithinTopControlRectangle.Width); 2088? Math.Min(currentTooltipSize.Width - 2 * BalloonOffsetX, screen.WorkingArea.Width) 2089: Math.Min(currentTooltipSize.Width, screen.WorkingArea.Width); 2240PInvokeCore.SendMessage(this, PInvoke.TTM_SETMAXTIPWIDTH, 0, screen.WorkingArea.Width);
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (10)
221if (bounds.Width < 0 || bounds.Height < 0) 250if (bounds.Width < 0 || bounds.Height < 0 || clipRectangle.Width < 0 || clipRectangle.Height < 0) 304if (bounds.Width < 0 || bounds.Height < 0) 322if (bounds.Width < 0 || bounds.Height < 0) 340if (bounds.Width < 0 || bounds.Height < 0) 381if (bounds.Width < 0 || bounds.Height < 0) 415if (bounds.Width < 0 || bounds.Height < 0) 431if (contentBounds.Width < 0 || contentBounds.Height < 0) 450if (bounds.Width < 0 || bounds.Height < 0)
System.Windows.Forms.Design (109)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (4)
587Rectangle res = e.Bounds with { X = e.Bounds.X + offset, Width = e.Bounds.Width - offset }; 599g.DrawRectangle(SystemPens.ControlText, baseVar.X, baseVar.Y, baseVar.Width - 1, baseVar.Height - 1); 617e.Bounds with { X = e.Bounds.X + offset, Width = e.Bounds.Width - offset }); 622if (width > e.Bounds.Width && _listBox.HorizontalExtent < width)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (2)
245Convert.ToInt32(dropDownRect.Left + dropDownRect.Width / 2), 249middle.X += (dropDownRect.Width % 2);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (3)
348dropDownSize.Width = Math.Max(editorBounds.Width + 1, dropDownSize.Width); 372dropDownSize.Width = Math.Max(editorBounds.Width + 1, dropDownSize.Width); 375Math.Max(rectScreen.X, editorLocation.X - editorBounds.Width)); // max = left screen edge clip
System\ComponentModel\Design\DesignerActionUI.cs (1)
616if ((new Rectangle(glyphCoord, new Size(currentGlyph.Bounds.Width, currentGlyph.Bounds.Height))).Contains(point))
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
241(int)Math.Min(Math.Ceiling(WatermarkSize.Width * 1.75), workingArea.Width / 3),
System\Drawing\Design\ColorEditor.ColorPalette.ColorPaletteAccessibleObject.ColorCellAccessibleObject.cs (1)
43return new Rectangle(pt.X, pt.Y, rect.Width, rect.Height);
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
315rectTabControl.Width - CMARGIN,
System\Drawing\Design\IconEditor.cs (2)
120if (icon.Width < rectangle.Width) 122rectangle.X += (rectangle.Width - icon.Width) / 2;
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (1)
271e.Graphics.DrawRectangle(SystemPens.WindowFrame, rc.X, rc.Y, rc.Width - 1, rc.Height - 1);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (4)
535Rectangle clipBounds = new(0, 0, rootControl.ClientRectangle.Width, rootControl.ClientRectangle.Height); 1020if (bounds.Left + bounds.Width < dragBounds.Left) 1025else if (dragBounds.Left + dragBounds.Width < bounds.Left) 1144Rectangle tempDragRect = new(dragBounds.Left + snapPoint.X, dragBounds.Top + snapPoint.Y, dragBounds.Width, dragBounds.Height);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
1007int imageWidth = _dragImageRect.Width;
System\Windows\Forms\Design\Behavior\GrabHandleGlyph.cs (4)
56if (controlBounds.Width >= (2 * DesignerUtils.s_handleOverlap) + (2 * DesignerUtils.s_handleSize)) 58bounds = new Rectangle(controlBounds.X + (controlBounds.Width / 2) - (DesignerUtils.s_handleSize / 2), controlBounds.Y + DesignerUtils.s_handleOverlap - DesignerUtils.s_handleSize, DesignerUtils.s_handleSize, DesignerUtils.s_handleSize); 68if (controlBounds.Width >= (2 * DesignerUtils.s_handleOverlap) + (2 * DesignerUtils.s_handleSize)) 70bounds = new Rectangle(controlBounds.X + (controlBounds.Width / 2) - (DesignerUtils.s_handleSize / 2), controlBounds.Bottom - DesignerUtils.s_handleOverlap, DesignerUtils.s_handleSize, DesignerUtils.s_handleSize);
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (11)
149rect.Width = Math.Max(rect.Width, _parentGridSize.Width); 619_resizeComponents[0].resizeBounds.Width, _resizeComponents[0].resizeBounds.Height); 625controlBounds.Offset(-controlBounds.Width, 0); 718bounds.Width = Math.Max(minWidth, baseBounds.Width + (!fRTL ? (mouseLoc.X - xOffset) : (xOffset - mouseLoc.X))); 732bounds.Width = Math.Max(minWidth, baseBounds.Width + xOffset); 733if ((bounds.Width != minWidth) || 734((bounds.Width == minWidth) && (oldBounds.Width != minWidth))) 767propWidth.SetValue(_resizeComponents[i].resizeControl, bounds.Width); 793control.SetBounds(bounds.X, bounds.Y, bounds.Width, bounds.Height, specified); 930if (propWidth is not null && _resizeComponents[i].resizeControl.Width != _resizeComponents[i].resizeBounds.Width)
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionGlyph.cs (6)
108x = (bounds.Width - _imageWidth) / 2; 117x = (bounds.Width - _imageWidth) / 2; 129_glyphBounds = new Rectangle(bounds.X + bounds.Width, bounds.Y + y, _imageHeight, _imageWidth); 157x = (bounds.Width - _imageWidth) / 2; 166x = (bounds.Width - _imageWidth) / 2; 178_glyphBounds = new Rectangle(bounds.X + bounds.Width, bounds.Y + y, _imageHeight, _imageWidth);
System\Windows\Forms\Design\ComponentTray.cs (2)
1860Point newLoc = new(bounds.X + bounds.Width + _whiteSpace.X, bounds.Y); 2288int x = rc.X + (rc.Width - _cxIcon) / 2;
System\Windows\Forms\Design\ControlCommandSet.cs (1)
725moveOffsetX = newRect.Width - primaryControl.Width;
System\Windows\Forms\Design\ControlDesigner.cs (1)
2253textRect.X = imageRect.X + imageRect.Width + 2 * marginX;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (3)
1004int textWidth = Size.Ceiling(e.Graphics.MeasureString(columnName, e.Font!, new SizeF(bounds.Width, bounds.Height))).Width; 1021e.Graphics.FillRectangle(backBrush, new Rectangle(focusRectangle.Right + 1, e.Bounds.Y, e.Bounds.Width - focusRectangle.Right - 1, e.Bounds.Height)); 1025e.Graphics.FillRectangle(backBrush, new Rectangle(bounds.X, e.Bounds.Y, e.Bounds.Width - bounds.X, e.Bounds.Height));
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
2031int w = bounds.Left + bounds.Width;
System\Windows\Forms\Design\DesignerUtils.cs (4)
462SelectionBorderGlyphType.Top => new Rectangle(originalBounds.Left - borderSize, originalBounds.Top - borderSize, originalBounds.Width + 2 * borderSize, borderSize), 463SelectionBorderGlyphType.Bottom => new Rectangle(originalBounds.Left - borderSize, originalBounds.Bottom, originalBounds.Width + 2 * borderSize, borderSize), 590newBounds.X = originalBounds.X - originalBounds.Width + e.Offset.X; 599newBounds.X = originalBounds.X - originalBounds.Width - e.Offset.X;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
155bounds.Width + margin.Horizontal,
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
413if (rectangle.Width == 0)
System\Windows\Forms\Design\ParentControlDesigner.cs (16)
567prop?.SetValue(newChild, new Size(bounds.Width, bounds.Height)); 812CreateToolCore(tool, bounds.X, bounds.Y, bounds.Width, bounds.Height, true, true); 1047if (translatedBounds.Width < 2 * DesignerUtils.s_containerGrabHandleSize) 1095adjustedRect.Width = dragRect.Width; 1172updatedRect.Width = ((dragRect.X + dragRect.Width) / gridSize.Width) * gridSize.Width - updatedRect.X; 1177if (updatedRect.Width < gridSize.Width) 1785offset.Width, offset.Height); 1825_statusCommandUI?.SetStatusInformation(new Rectangle(location.X, location.Y, offset.Width, offset.Height)); 1862if (offset.Width < minControlSize.Width) 1947if (_mouseDragOffset.Width < 0) 1949_mouseDragOffset.X += _mouseDragOffset.Width; 1950_mouseDragOffset.Width = -_mouseDragOffset.Width; 1977_mouseDragOffset.Width, _mouseDragOffset.Height); 2016_statusCommandUI?.SetStatusInformation(new Rectangle(offset.X, offset.Y, _mouseDragOffset.Width, _mouseDragOffset.Height)); 2034Math.Max(displayRect.Width, clientRect.Width),
System\Windows\Forms\Design\SelectionUIHandler.cs (7)
76containerRect.Width = screen.Width; 239if (finalMove && offset is { X: 0, Y: 0, Width: 0, Height: 0 }) 290ctlBounds.lastRequestedWidth += offset.Width; 373newBounds.Width = tempNewBounds.Width; 378newBounds.Width = tempNewBounds.Width; 383bool sizeChanged = (offset.Width != 0 || offset.Height != 0); 484Size size = new(Math.Max(MinControlWidth, newBounds.Width), Math.Max(MinControlHeight, newBounds.Height));
System\Windows\Forms\Design\SelectionUIService.cs (2)
694delta.Width -= old.Width; 696if (delta.X != 0 || delta.Y != 0 || delta.Width != 0 || delta.Height != 0)
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (16)
157rect.X = inner.X + inner.Width; 166rect.X += (outer.Width - GRABHANDLE_WIDTH) / 2; 176rect.X = inner.X + inner.Width; 273if (pt.X >= _innerRect.X + _innerRect.Width && pt.X <= _outerRect.X + _outerRect.Width) 278if (pt.X >= _outerRect.X + (_outerRect.Width - GRABHANDLE_WIDTH) / 2 279&& pt.X <= _outerRect.X + (_outerRect.Width + GRABHANDLE_WIDTH) / 2) 287if (pt.X >= _innerRect.X + _innerRect.Width && pt.X <= _outerRect.X + _outerRect.Width) 310Debug.Assert(!(pt.X >= _innerRect.X + _innerRect.Width && pt.X <= _outerRect.X + _outerRect.Width), "Should be handled by right bottom check"); 312if (pt.X >= _outerRect.X + (_outerRect.Width - GRABHANDLE_WIDTH) / 2 && pt.X <= _outerRect.X + (_outerRect.Width + GRABHANDLE_WIDTH) / 2) 390if (pt.X < _outerRect.X || pt.X > _outerRect.X + _outerRect.Width) 401&& pt.X < _innerRect.X + _innerRect.Width 514Rectangle rcOuterNew = new(_innerRect.X - GRABHANDLE_WIDTH, _innerRect.Y - GRABHANDLE_HEIGHT, _innerRect.Width + 2 * GRABHANDLE_WIDTH, _innerRect.Height + 2 * GRABHANDLE_HEIGHT);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
192int watermarkX = rectangle.Width / 2 - (int)g.MeasureString(name, drawFont).Width / 2;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
1136Rectangle gBounds = new(checkBounds.Left, startLoc - halfSize, checkBounds.Width, DesignerUtils.s_resizeGlyphSize);
System\Windows\Forms\Design\TabOrder.cs (1)
286graphics.DrawRectangle(pen, convertedRectangle.X, convertedRectangle.Y, convertedRectangle.Width - 1, convertedRectangle.Height - 1);
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1372if (translatedBounds.Width < 2 * DesignerUtils.s_containerGrabHandleSize)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (5)
1181if (_toolStripAdornerWindowService is not null && (dropDown.Width < _dropDownSizeToInvalidate.Width || dropDown.Size.Height < _dropDownSizeToInvalidate.Height)) 1373if (!(dropDownItem.Owner is ToolStripDropDownMenu) && dropDownItem is not null && dropDownItem.Bounds.Width < _commitedEditorNode.Bounds.Width) 1376dropDownItem.DropDown.Location = new Point(dropDownItem.DropDown.Location.X + _commitedEditorNode.Bounds.Width - dropDownItem.Bounds.Width, dropDownItem.DropDown.Location.Y);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (3)
1873Rectangle drawRect = new(bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 1887Rectangle drawRect = new(bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 2032Rectangle drawRect = new(bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1);
System.Windows.Forms.Primitives (4)
System\Windows\Forms\Automation\UiaTextProvider.cs (2)
94result[scan++] = rectArray[i].Width; 112result[2] = bounds.Width;
System\Windows\Forms\Automation\UiaTextRange.cs (2)
401if (rectangle.Width > 0 && rectangle.Height > 0) 866if (rect.Width > 0 && rect.Height > 0)
System.Windows.Forms.Primitives.Tests (2)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (2)
716.Returns((Rectangle rect) => new Rectangle(rect.X + 27, rect.Y + 128, rect.Width, rect.Height)); 798.Returns((Rectangle rect) => new Rectangle(rect.X + 27, rect.Y + 128, rect.Width, rect.Height));
System.Windows.Forms.Tests (170)
System\Windows\Forms\AccessibleObjects\AccessibleObjectTests.cs (6)
634Assert.Equal(0, accessibleObject.Bounds.Width); 700Assert.Equal(0, accessibleObject.Bounds.Width); 719Assert.Equal(0, accessibleObject.Bounds.Width); 738Assert.Equal(0, accessibleObject.Bounds.Width); 2627point.Offset(bounds.Width / 2, bounds.Height / 2); 2658point.Offset(bounds.Width / 2, bounds.Height / 2);
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (1)
414Assert.Equal(itemWidth, actual.Width); // All items are the same width
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (2)
67Assert.Equal(0, accessibleObject.Bounds.Width); 102Assert.Equal(0, accessibleObject.Bounds.Width);
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (2)
150int actualWidth = accessibleObject.Bounds.Width; 173int actualWidth = accessibleObject.Bounds.Width;
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (2)
297int actualWidth = group1AccObj.Bounds.Width; 335int actualWidth = groupAccObj.Bounds.Width;
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
655int actualWidth = accessibleObject.Bounds.Width;
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (1)
37Assert.Equal(217, bounds.Width);
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarBodyAccessibleObjectTests.cs (1)
33Assert.Equal(217, accessibleObject.Bounds.Width);
System\Windows\Forms\AccessibleObjects\Panel.PanelAccessibleObjectTests.cs (2)
283Assert.Equal(boundingRectangle.Width, expected.Width + verticalScrollBarWidth);
System\Windows\Forms\AccessibleObjects\TabPage.TabPageAccessibleObjectTests.cs (2)
555Assert.Equal(boundingRectangle.Width, expected.Width + verticalScrollBarWidth);
System\Windows\Forms\AccessibleObjects\ToolStripControlHost.ToolStripHostedControlAccessibleObjectTests.cs (1)
31(bool)accessibleObject.GetPropertyValue(UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId) || (accessibleObject.Bounds.Width > 0 && accessibleObject.Bounds.Height > 0);
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (1)
123(toolStripItemAccessibleObject.Bounds.Width > 0 && toolStripItemAccessibleObject.Bounds.Height > 0));
System\Windows\Forms\ControlPaintTests.cs (26)
767ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); 770ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); 779ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style); 782ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style); 791ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style, side); 794ControlPaint.DrawBorder3D(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, style, side); 839ControlPaint.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 842ControlPaint.DrawButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 923ControlPaint.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state); 926ControlPaint.DrawCaptionButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state); 1003ControlPaint.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1006ControlPaint.DrawCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1084ControlPaint.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1087ControlPaint.DrawComboButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1446ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph); 1449ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph); 1458ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph, foreColor, backColor); 1461ControlPaint.DrawMenuGlyph(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, glyph, foreColor, backColor); 1545ControlPaint.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1548ControlPaint.DrawMixedCheckBox(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1625ControlPaint.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1628ControlPaint.DrawRadioButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, state); 1763ControlPaint.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state); 1766ControlPaint.DrawScrollButton(graphics, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, button, state); 1883ControlPaint.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); 1886ControlPaint.DrawSizeGrip(graphics, backColor, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
System\Windows\Forms\ControlTests.Methods.cs (6)
10402Assert.True(control.ClientRectangle.Width > 0); 10406Assert.True(control.DisplayRectangle.Width > 0); 10418Assert.True(control.Bounds.Width > 0); 10435Assert.True(control.ClientRectangle.Width > 0); 10439Assert.True(control.DisplayRectangle.Width > 0); 10451Assert.True(control.Bounds.Width > 0);
System\Windows\Forms\CursorTests.cs (2)
184Assert.True(clip.Width >= 0); 204Assert.True(Cursor.Clip.Width >= 0);
System\Windows\Forms\DataGridViewCellTests.cs (5)
3228Assert.Equal(new Rectangle(expected.X, expected.Y, expected.Width, expected.Height + 10), cell.BorderWidths(advancedBorderStyle)); 3241Assert.Equal(new Rectangle(expected.X, expected.Y, expected.Width + 10, expected.Height), cell.BorderWidths(advancedBorderStyle)); 3259Assert.Equal(new Rectangle(expected.X, expected.Y, expected.Width + 10, expected.Height + 11), cell.BorderWidths(advancedBorderStyle)); 3280Assert.Equal(new Rectangle(expected.X + 10, expected.Y, expected.Width, expected.Height + 11), cell.BorderWidths(advancedBorderStyle)); 3296Assert.Equal(new Rectangle(expected.X, expected.Y, expected.Width + 10, expected.Height), cell.BorderWidths(advancedBorderStyle));
System\Windows\Forms\FormTests.cs (1)
80Assert.True(control.DisplayRectangle.Width > 0);
System\Windows\Forms\HScrollBarTests.cs (3)
30Assert.True(control.Bounds.Width > 0); 41Assert.True(control.ClientRectangle.Width > 0); 63Assert.True(control.DisplayRectangle.Width > 0);
System\Windows\Forms\ListBoxTests.cs (5)
770Assert.Equal(123, ((Rectangle)rc).Width); 5333Assert.True(rect1.Width > 0); 5341Assert.True(rect2.Width > 0); 5363Assert.True(rect1.Width > 0); 5374Assert.True(rect2.Width > 0);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (7)
152Assert.Equal(expectedWidth, ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().Width); 169int actualWidth = ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().Width; 171Assert.True(columnWidth > ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().Width); 185: listView.GetItemRect(0, ItemBoundsPortion.Label).Width; 187Assert.Equal(expectedWidth, ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().Width); 201: listView.GetItemRect(0, ItemBoundsPortion.Label).Width; 203Assert.Equal(expectedWidth, ((IKeyboardToolTip)listViewItem).GetNativeScreenRectangle().Width);
System\Windows\Forms\ListViewTests.cs (4)
4092Assert.True(rect1.Width > 0); 4099Assert.True(rect2.Width > 0); 4123Assert.True(rect1.Width > 0); 4133Assert.True(rect2.Width > 0);
System\Windows\Forms\MonthCalendarTests.cs (3)
39Assert.True(control.Bounds.Width > 0); 52Assert.True(control.ClientRectangle.Width > 0); 72Assert.True(control.DisplayRectangle.Width > 0);
System\Windows\Forms\ScreenTests.cs (5)
209Assert.NotEqual(0, screen.Bounds.Width); 213Assert.InRange(screen.WorkingArea.Width, 0, screen.Bounds.Width); 215Assert.InRange(screen.WorkingArea.X, screen.Bounds.X, screen.Bounds.X + screen.Bounds.Width); 216Assert.InRange(screen.WorkingArea.Y, screen.Bounds.Y, screen.Bounds.Y + screen.Bounds.Width);
System\Windows\Forms\ScrollBarTests.cs (8)
2939Assert.True(HFirstPageButton(hScrollBar).Bounds.Width > 0); 2953Assert.True(HFirstPageButton(hScrollBar).Bounds.Width == 0 || HFirstPageButton(hScrollBar).Bounds.Height == 0); 2983Assert.True(HLastPageButton(hScrollBar).Bounds.Width > 0); 2997Assert.True(HLastPageButton(hScrollBar).Bounds.Width == 0 || HLastPageButton(hScrollBar).Bounds.Height == 0); 3027Assert.True(VFirstPageButton(vScrollBar).Bounds.Width == 0 || VFirstPageButton(vScrollBar).Bounds.Height == 0); 3040Assert.True(VLastPageButton(vScrollBar).Bounds.Width > 0); 3054Assert.True(VLastPageButton(vScrollBar).Bounds.Width == 0 || VLastPageButton(vScrollBar).Bounds.Height == 0); 3084Assert.True(VFirstPageButton(vScrollBar).Bounds.Width > 0);
System\Windows\Forms\SplitterTests.cs (1)
1421Assert.Equal(control.Left + control.Bounds.Width / 2, e.SplitX);
System\Windows\Forms\StatusStripTests.Rendering.cs (2)
36Rectangle bitBltBounds = new(bounds.X, 0, bounds.Width - 1, bounds.Height - 1); 37Rectangle polylineBounds = new(bounds.X, 0, bounds.Width - 1, 15);
System\Windows\Forms\SystemInformationTests.cs (2)
792Assert.NotEqual(0, screen.Width); 803Assert.True(workingArea.Width > 0);
System\Windows\Forms\TabControlTests.cs (9)
745Assert.Equal(200 - displayRectangle.X * 2, control.DisplayRectangle.Width); 766Assert.Equal(200 - displayRectangle.X * 2, control.DisplayRectangle.Width); 785Assert.Equal(200 - displayRectangle.X * 2, control.DisplayRectangle.Width); 3662Assert.True(rect1.Width > 0); 3668Assert.True(rect2.X >= rect1.X + rect1.Width); 3670Assert.True(rect2.Width > 0); 3694Assert.True(rect1.Width > 0); 3700Assert.True(rect2.X >= rect1.X + rect1.Width); 3702Assert.True(rect2.Width > 0);
System\Windows\Forms\TabPageTests.cs (16)
2214Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.ClientRectangle); 2215Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.DisplayRectangle); 2218Assert.Equal(expected.X + expected.Width, control.Right); 2222Assert.Equal(expected.Width, control.Width); 2244Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.ClientRectangle); 2245Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.DisplayRectangle); 2248Assert.Equal(expected.X + expected.Width, control.Right); 2252Assert.Equal(expected.Width, control.Width); 4816Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.ClientRectangle); 4817Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.DisplayRectangle); 4820Assert.Equal(expected.X + expected.Width, control.Right); 4824Assert.Equal(expected.Width, control.Width); 4846Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.ClientRectangle); 4847Assert.Equal(new Rectangle(0, 0, expected.Width, expected.Height), control.DisplayRectangle); 4850Assert.Equal(expected.X + expected.Width, control.Right); 4854Assert.Equal(expected.Width, control.Width);
System\Windows\Forms\TextBoxRendererTests.cs (3)
44? Validate.Polygon16(new(new(1, 1), new(bounds.Width - 2, bounds.Height - 2))) 74? Validate.Polygon16(new(new(1, 1), new(bounds.Width - 2, bounds.Height - 2))) 110? Validate.Polygon16(new(new(1, 1), new(bounds.Width - 2, bounds.Height - 2)))
System\Windows\Forms\ToolStripButtonTests.cs (4)
1304Assert.Equal(0, e.ImageRectangle.Width); 1322Assert.True(e.TextRectangle.Width >= 0); 1395Assert.Equal(0, e.ImageRectangle.Width); 1413Assert.True(e.TextRectangle.Width >= 0);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
4893items[i].SetBounds(0, items[i - 1].Bounds.Bottom + 1, items[i].Bounds.Width, items[i].Bounds.Height);
System\Windows\Forms\ToolStripItemTests.cs (10)
14561Assert.Equal(bounds.Width, item.Width); 14569Assert.Equal(bounds.Width, item.Width); 14599Assert.Equal(bounds.Width, item.Width); 14609Assert.Equal(bounds.Width, item.Width); 14653Assert.Equal(bounds.Width, item.Width); 14666Assert.Equal(bounds.Width, item.Width); 14727Assert.Equal(bounds.Width, item.Width); 14737Assert.Equal(bounds.Width, item.Width); 14788Assert.Equal(bounds.Width, item.Width); 14801Assert.Equal(bounds.Width, item.Width);
System\Windows\Forms\ToolStripSeparatorTests.cs (8)
1381Assert.Equal(bounds.Width, item.Width); 1389Assert.Equal(bounds.Width, item.Width); 1419Assert.Equal(bounds.Width, item.Width); 1429Assert.Equal(bounds.Width, item.Width); 1549Assert.Equal(bounds.Width, item.Width); 1559Assert.Equal(bounds.Width, item.Width); 1603Assert.Equal(bounds.Width, item.Width); 1613Assert.Equal(bounds.Width, item.Width);
System\Windows\Forms\ToolStripTests.cs (2)
102Assert.True(control.GripRectangle.Width > 0); 256Assert.True(control.GripRectangle.Width > 0);
System\Windows\Forms\ToolStripTests.Rendering.cs (9)
33Rectangle bitBltBounds = new(bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); 37new(bounds.Width - 3, 0, bounds.Width, 1), 38new(bounds.Width - 1, 1, bounds.Width, 3), 40new(bounds.Width - 1, bounds.Height - 2, bounds.Width, bounds.Height - 1), 42new(bounds.Width - 2, bounds.Height - 1, bounds.Width, bounds.Height)
System\Windows\Forms\TreeNodeCollectionTests.cs (1)
22Assert.True(treeNode.Bounds.Width > 0);
System\Windows\Forms\TreeNodeTests.cs (2)
459Assert.True(bounds.Width > 0); 481Assert.True(bounds.Width > 0);
System\Windows\Forms\VScrollBarTests.cs (3)
29Assert.True(control.Bounds.Width > 0); 40Assert.True(control.ClientRectangle.Width > 0); 62Assert.True(control.DisplayRectangle.Width > 0);
System.Windows.Forms.UI.IntegrationTests (28)
AnchorLayoutTests.cs (4)
223button.SetBounds(bounds.X + 5, bounds.Y + 5, bounds.Width + 10, bounds.Height + 10, BoundsSpecified.None); 226button.SetBounds(bounds.X + 5, bounds.Y + 5, bounds.Width + 10, bounds.Height + 10, BoundsSpecified.All); 230button.SetBounds(bounds.X + 5, bounds.Y + 5, bounds.Width + 10, bounds.Height + 10); 252Assert.Equal(expectedWidth, newButtonBounds.Width);
ButtonTests.cs (9)
127.MoveMouseBy(form.DisplayRectangle.Width, 0) 130Assert.True(form.DisplayRectangle.Width > originalFormSize.Width); 144Point mouseDragHandleOnForm = new(form.DisplayRectangle.Left + form.DisplayRectangle.Width / 2, form.DisplayRectangle.Bottom); 155Assert.Equal(originalFormSize.Width, form.DisplayRectangle.Width); 177.MoveMouseBy(form.DisplayRectangle.Width, 0) 180Assert.True(form.DisplayRectangle.Width > originalFormSize.Width); 186Assert.Equal(originalFormSize.Width - originalButtonPosition.Right, form.DisplayRectangle.Width - button.DisplayRectangle.Right); 200Point mouseDragHandleOnForm = new(form.DisplayRectangle.Left + form.DisplayRectangle.Width / 2, form.DisplayRectangle.Bottom); 211Assert.Equal(originalFormSize.Width, form.DisplayRectangle.Width);
Dpi\FormDpiTests.cs (2)
41Assert.NotEqual(initialBounds.Width, form.Bounds.Width);
DragDropTests.cs (4)
199X = (startCoordinates.X - vscreen.Left) * DesktopNormalizedMax / vscreen.Width + DesktopNormalizedMax / (vscreen.Width * 2), 204X = (endCoordinates.X - vscreen.Left) * DesktopNormalizedMax / vscreen.Width + DesktopNormalizedMax / (vscreen.Width * 2),
FormTests.cs (7)
65int borderSize = (form.Width - form.ClientRectangle.Width) / 2; 76Assert.True(form.Width >= screenWorkingArea.Width / 2); 77Assert.True(form.Width <= (screenWorkingArea.Width / 2) + (borderSize * 2)); 125int screenMiddleX = screenWorkingArea.X + (screenWorkingArea.Width / 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));
Infra\ScreenshotService.cs (1)
52int width = primaryScreen.Bounds.Width;
ListBoxItemAccessibleObjestTests.cs (1)
30boundsAfterHandleCreation.Width.Should().BeLessOrEqualTo(listBox.Width);
WindowsFormsIntegration (3)
System\Windows\Integration\HostUtils.cs (3)
174if (control.ClientRectangle.Width == 0 || control.ClientRectangle.Height == 0) 179SD.Bitmap bitmap = new SD.Bitmap(control.ClientRectangle.Width, control.ClientRectangle.Height); 197SD.Bitmap returnBitmap = new SD.Bitmap(childElementHost.ClientRectangle.Width, childElementHost.ClientRectangle.Height);
WinFormsControlsTest (2)
CustomComCtl32Button.cs (1)
99int width = sender.ClientRectangle.Width - 10;
TrackBars.cs (1)
43trackBar1.Width = ClientRectangle.Width - trackBar1.Left * 2;