141 writes to Height
System.Windows.Forms (127)
System\Windows\Forms\ActiveX\AxHost.cs (2)
1084sz.Height = (int)pcont.Y; 1097sz.Height = phm.Y;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
702pSizel->Height = pt.Y;
System\Windows\Forms\Control.cs (1)
9841size.Height = (int)Math.Round(size.Height * y);
System\Windows\Forms\Controls\Buttons\Button.cs (1)
102requiredSize.Height += 9;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
952proposedSize.Height = 0;
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
288size.Height = Math.Max(size.Height + 5, _flatSystemStyleMinimumHeight);
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
259size.Height = ScaleHelper.IsScalingRequirementMet
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
400preferredSize.Height += borderAndPaddingHeights + marginHeights + 2 * DATAGRIDVIEWBUTTONCELL_verticalTextMargin; 404preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (8)
664checkBoxSize.Height -= 3; 668checkBoxSize.Height -= 2; 736preferredSize.Height += borderWidths.Y; 749preferredSize.Height = Math.Max(preferredSize.Height, 1171checkBoxSize.Height -= 3; 1175checkBoxSize.Height -= 2; 1186checkBoxSize.Height -= 3; 1191checkBoxSize.Height -= 2;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (6)
622preferredSize.Height = Math.Max(preferredSize.Height, glyphSize.Height); 623preferredSize.Height = Math.Max(preferredSize.Height, 1); 664preferredSize.Height = Math.Max(preferredSize.Height, s_sortGlyphHeight); 668preferredSize.Height = Math.Max(preferredSize.Height, 1); 685preferredSize.Height += 2 * VerticalMargin + borderAndPaddingHeights; 698preferredSize.Height += rectThemeMargins.Y + rectThemeMargins.Height;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (5)
1192preferredSize.Height = 0; 1211preferredSize.Height += 6; 1215preferredSize.Height += 8; 1218preferredSize.Height += borderAndPaddingHeights; 1222preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (3)
512preferredSize.Height = 0; 528preferredSize.Height += borderAndPaddingHeights; 532preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (3)
654preferredSize.Height += VerticalTextMarginTop + VerticalTextMarginBottom + borderAndPaddingHeights; 657preferredSize.Height += VerticalTextMarginBottom; 663preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (2)
497preferredSize.Height += verticalTextMarginTop + DATAGRIDVIEWTEXTBOXCELL_verticalTextMarginBottom + borderAndPaddingHeights; 501preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (4)
274preferredSize.Height += 2 * VerticalTextMargin; 293preferredSize.Height = Math.Max(preferredSize.Height, 298preferredSize.Height += borderAndPaddingHeights; 338sizeConstraint.Height = sizeCell.Height;
System\Windows\Forms\Controls\Labels\Label.cs (3)
1009bordersAndPadding.Height += 6; // taken from Everett.PreferredHeight 1014bordersAndPadding.Height += 3; // taken from Everett.PreferredHeight 1041proposedSize.Height = 0;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (5)
1212_dimensions.Height = 1; 1217_dimensions.Height = (nRows < 1) ? 1 : nRows; 1235minSize.Height = (calendarHeight + InsertHeightSize) * _dimensions.Height - InsertHeightSize + todayHeight; 1249minSize.Height += _extraPadding; 1788_dimensions.Height = y;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
2830size.Height = Math.Max(0, yNew);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (1)
152size.Height = Math.Max(0, size.Height - 2 * _borderSize);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (2)
1864size.Height = sizeWindow.Height; 1875size.Height -= 2;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (3)
300newSize.Height += s_resizeBarSize; 625size.Height += (linkHeight + (DropDownHolderBorder * 2)); 631size.Height += s_resizeBarSize;
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
433scrollBarPadding.Height += SystemInformation.HorizontalScrollBarHeight;
System\Windows\Forms\Controls\TextBox\TextBox.cs (1)
407scrollBarPadding.Height += SystemInformation.GetHorizontalScrollBarHeightForDpi(_deviceDpi);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (2)
832bordersAndPadding.Height += 2; 853textSize.Height = Math.Max(textSize.Height, FontHeight);
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
306proposedSize.Height = int.MaxValue;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (7)
2245proposedSize.Height = int.MaxValue; 2274maxSize.Height = Math.Max(0, defaultSize.Height); 2291maxSize.Height = Math.Max(maxSize.Height, itemMargin.Vertical + prefItemSize.Height); 2349maxSize.Height += itemMargin.Vertical + preferredSize.Height; 2370maxSize.Height += overflowItemMargin.Vertical + overflowItem.Bounds.Height; 2374maxSize.Height += 2; // add Padding to the bottom if not Overflow. 2381maxSize.Height += gripMargin.Vertical + toolStrip.Grip.GripThickness;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (1)
42preferredSize.Height += DropDownArrowRect.Height + _dropDownArrowPadding.Vertical;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (11)
299menuItemTextSize.Height = Math.Max(menuItemTextSize.Height, shortcutTextSize.Height); 304maxTextSize.Height = Math.Max(maxTextSize.Height, menuItemTextSize.Height); 314maxImageSize.Height = Math.Max(maxImageSize.Height, imageSize.Height); 320maxCheckSize.Height = Math.Max(checkedImageSize.Height, maxCheckSize.Height); 325maxNonMenuItemSize.Height = Math.Max(item.Bounds.Height, maxNonMenuItemSize.Height); 330_maxItemSize.Height = Math.Max(maxTextSize.Height + _textPadding.Vertical, Math.Max(maxCheckSize.Height + _checkPadding.Vertical, maxArrowSize.Height + _arrowPadding.Vertical)); 335_maxItemSize.Height = Math.Max(maxImageSize.Height + _imagePadding.Vertical, _maxItemSize.Height); 341maxTextSize.Height = _maxItemSize.Height - _textPadding.Vertical; 342maxImageSize.Height = _maxItemSize.Height - _imagePadding.Vertical; 343maxCheckSize.Height = _maxItemSize.Height - _checkPadding.Vertical; 454_maxItemSize.Height += _maxItemSize.Height % 2;
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (1)
98preferredSize.Height = constrainingSize.Height;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
82preferredSize.Height = Math.Min(constrainingSize.Height, s_maxSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (3)
181_maxSize.Height += growBy; 278constrainingSize.Height = ToolStripPanelRow.Bounds.Height; 280preferredSize.Height = constrainingSize.Height;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
680preferredSize.Height = DisplayRectangle.Height;
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (1)
126preferredSize.Height = (Label.Image is not null) ? Label.Image.Height + 4 : 0;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
277constrainingSize.Height = SeparatorHeight;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (1)
334itemSize.Height = Math.Max(_displayRectangle.Height - itemMargin.Vertical, 0);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (3)
200_webBrowserBaseChangingSize.Height = height; 1119sz.Height = (int)pcont.Y; 1131sz.Height = phm.Y;
System\Windows\Forms\Design\ComponentEditorForm.cs (1)
359_maxSize.Height = pageSize.Height;
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (2)
222textSize.Height += _scaledExceptionMessageVerticalPadding; 230textSize.Height = _scaledMaxHeight;
System\Windows\Forms\Form.cs (5)
1225minimumSize.Height = value.Height; 1342maximumSize.Height = value.Height; 3037correctClientSize.Height += SystemInformation.HorizontalScrollBarHeight; 3067correct.Height += SystemInformation.HorizontalScrollBarHeight; 4552desiredSize.Height = (int)(Size.Height * autoScaleFactor.Height);
System\Windows\Forms\Layout\DefaultLayout.cs (8)
44proposedConstraints.Height = bounds.Height; 500neededSize.Height = 0; 559newSize.Height = remainingSize.Height; 563newSize.Height = Math.Max(newSize.Height, remainingSize.Height); 678preferredSizeForAnchoring.Height -= containerPadding.Top; 1137prefSize.Height = Math.Max(prefSize.Height, elementSpace.Bottom); 1168prefSize.Height = Math.Max(prefSize.Height, anchorInfo is null ? bounds.Bottom : bounds.Bottom + anchorInfo.Bottom); 1172prefSize.Height = anchorDest.Height < 0
System\Windows\Forms\Layout\FlowLayout.cs (4)
94layoutSize.Height += rowSize.Height; 208prefSize.Height = 0; 214prefSize.Height = elementProxy.MinimumSize.Height; 253rowSize.Height = Math.Max(rowSize.Height, requiredSize.Height);
System\Windows\Forms\Layout\LayoutUtils.cs (7)
52largestSize.Height = Math.Max(largestSize.Height, textSize.Height); 133size.Height = int.MaxValue; 366stretchedSize.Height = withinThis.Height; 400currentSize.Height += contentSize.Height; 405currentSize.Height = Math.Max(currentSize.Height, contentSize.Height); 456(size.Height, size.Width) = (size.Width, size.Height); 579currentSize.Height -= contentSize.Height;
System\Windows\Forms\Layout\TableLayout.cs (4)
109containerSize.Height = Math.Max(containerSize.Height, 1); 166containerSize.Height = Math.Max(containerSize.Height, 1); 179proposedConstraints.Height = Math.Max(proposedConstraints.Height, 1); 647preferredSize.Height = InflateRows(containerInfo, proposedConstraints, expandLastElementWidth, measureOnly);
System\Windows\Forms\Rendering\TextExtensions.cs (1)
241proposedSize.Height = 1;
System\Windows\Forms\Scrolling\ScrollableControl.cs (2)
343_scrollMargin.Height += Padding.Bottom; 365_scrollMargin.Height += current.Size.Height;
System\Windows\Forms\ToolTip\ToolTip.cs (1)
2076currentTooltipSize.Height = rect.Height;
System.Windows.Forms.Design (9)
System\Windows\Forms\Design\CommandSet.cs (3)
2348itemSize.Height = primarySize.Height; 2431size.Height = ((size.Height + (grid.Height / 2)) / grid.Height) * grid.Height; 3356gridSize.Height = 8;
System\Windows\Forms\Design\ComponentTray.cs (1)
2192minDrag.Height = Math.Max(minDrag.Height, minDblClick.Height);
System\Windows\Forms\Design\ControlDesigner.cs (1)
1381minDrag.Height = Math.Max(minDrag.Height, minDblClick.Height);
System\Windows\Forms\Design\DesignerOptions.cs (2)
37value.Height = MinGridSize; 47value.Height = MaxGridSize;
System\Windows\Forms\Design\DesignerUtils.cs (1)
147s_minDragSize.Height = Math.Max(minDrag.Height, minDblClick.Height);
System\Windows\Forms\Design\FormDocumentDesigner.cs (1)
116size.Height += SystemInformation.HorizontalScrollBarHeight;
System.Windows.Forms.Tests (2)
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (2)
348CalendarDimensions = new Size { Width = 2, Height = 2 } 390CalendarDimensions = new Size { Width = 2, Height = 2 }
WindowsFormsIntegration (3)
System\Windows\Integration\HostUtils.cs (3)
45if (size.Height == 0) { size.Height = int.MaxValue; } 53if (size.Height == 0 || size.Height == 1) { size.Height = int.MaxValue; } 65size.Height = 0;
958 references to Height
PresentationFramework-SystemDrawing (2)
SystemDrawingExtension.cs (2)
83height = bitmapData.Size.Height; 100int bitmapheight = metafile.Size.Height;
PresentationUI (3)
MS\Internal\Documents\RMPublishingDialog.cs (2)
924buttonAddUser.Size.Height, 925buttonAddUser.Size.Height);
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (1)
1036cellBounds.Y + (cellBounds.Height - boxSize.Height) / 2);
System.ComponentModel.TypeConverter (2)
System\Drawing\SizeConverter.cs (2)
76intConverter.ConvertToString(context, culture, size.Height) 85return new InstanceDescriptor(ctor, new object[] { size.Width, size.Height });
System.Drawing.Common.Tests (34)
mono\System.Drawing.Imaging\BmpCodecTests.cs (5)
58Assert.Equal(183, bmp.Size.Height); 124Assert.Equal(183, bmp.Size.Height); 190Assert.Equal(183, bmp.Size.Height); 376Assert.Equal(183, bmp.Size.Height); 507Assert.Equal(60, bmp.Size.Height);
mono\System.Drawing.Imaging\GifCodecTests.cs (1)
55Assert.Equal(100, bmp.Size.Height);
mono\System.Drawing.Imaging\IconCodecTests.cs (6)
92Assert.Equal(16, bmp.Size.Height); 240Assert.Equal(32, bmp.Size.Height); 445Assert.Equal(48, bmp.Size.Height); 667Assert.Equal(64, bmp.Size.Height); 925Assert.Equal(96, bmp.Size.Height); 1859Assert.Equal(16, bmp.Size.Height);
mono\System.Drawing.Imaging\JpegCodecTests.cs (2)
57Assert.Equal(100, bmp.Size.Height); 184Assert.Equal(100, bmp.Size.Height);
mono\System.Drawing.Imaging\PngCodecTests.cs (3)
63Assert.Equal(384, bmp.Size.Height); 265Assert.Equal(100, bmp.Size.Height); 387Assert.Equal(384, bmp.Size.Height);
mono\System.Drawing.Imaging\TiffCodecTests.cs (1)
57Assert.Equal(183, bmp.Size.Height);
System\Drawing\BufferedGraphicsContextTests.cs (6)
35using BufferedGraphics bufferedGraphics = context.Allocate(graphics, new Rectangle(0, 0, context.MaximumBuffer.Width - 1, context.MaximumBuffer.Height - 1)); 47using BufferedGraphics bufferedGraphics = context.Allocate(graphics, new Rectangle(0, 0, context.MaximumBuffer.Width + 1, context.MaximumBuffer.Height + 1)); 84using (BufferedGraphics bufferedGraphics = context.Allocate(hdc, new Rectangle(0, 0, context.MaximumBuffer.Width - 1, context.MaximumBuffer.Height - 1))) 106using (BufferedGraphics bufferedGraphics = context.Allocate(hdc, new Rectangle(0, 0, context.MaximumBuffer.Width + 1, context.MaximumBuffer.Height + 1))) 150Rectangle largeRectangle = new(0, 0, context.MaximumBuffer.Width + 1, context.MaximumBuffer.Height + 1); 165Rectangle largeRectangle = new(0, 0, context.MaximumBuffer.Width + 1, context.MaximumBuffer.Height + 1);
System\Drawing\BufferedGraphicsTests.cs (1)
29BufferedGraphics graphics = context.Allocate(targetGraphics, new Rectangle(0, 0, context.MaximumBuffer.Width + 1, context.MaximumBuffer.Height + 1));
System\Drawing\IconTests.cs (9)
70using Icon icon = new(Helpers.GetTestBitmapPath(fileName), size.Width, size.Height); 72Assert.Equal(expectedSize.Height, icon.Height); 82Assert.Equal(expectedSize.Height, icon.Height); 125using Icon icon = new(stream, size.Width, size.Height); 127Assert.Equal(expectedSize.Height, icon.Height); 138Assert.Equal(expectedSize.Height, icon.Height); 223using Icon icon = new(sourceIcon, size.Width, size.Height); 225Assert.Equal(expectedSize.Height, icon.Height); 237Assert.Equal(expectedSize.Height, icon.Height);
System.Drawing.Primitives (17)
System\Drawing\Point.cs (3)
40y = sz.Height; 113public static Point Add(Point pt, Size sz) => new Point(unchecked(pt.X + sz.Width), unchecked(pt.Y + sz.Height)); 118public static Point Subtract(Point pt, Size sz) => new Point(unchecked(pt.X - sz.Width), unchecked(pt.Y - sz.Height));
System\Drawing\PointF.cs (2)
120public static PointF Add(PointF pt, Size sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); 125public static PointF Subtract(PointF pt, Size sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height);
System\Drawing\Rectangle.cs (3)
44height = size.Height; 78Height = value.Height; 259public void Inflate(Size size) => Inflate(size.Width, size.Height);
System\Drawing\Size.cs (9)
47public static implicit operator SizeF(Size p) => new SizeF(p.Width, p.Height); 111public static bool operator ==(Size sz1, Size sz2) => sz1.Width == sz2.Width && sz1.Height == sz2.Height; 121public static explicit operator Point(Size size) => new Point(size.Width, size.Height); 151new Size(unchecked(sz1.Width + sz2.Width), unchecked(sz1.Height + sz2.Height)); 163new Size(unchecked(sz1.Width - sz2.Width), unchecked(sz1.Height - sz2.Height)); 187public override readonly int GetHashCode() => HashCode.Combine(Width, Height);
System.Private.Windows.Core (2)
System\Private\Windows\Core\BinaryFormat\BinaryFormatWriter.cs (1)
189value.Height).Write(writer);
Windows\Win32\Foundation\RECT.cs (1)
13bottom = size.Height;
System.Private.Windows.GdiPlus (1)
System\Drawing\IIconExtensions.cs (1)
25size.Height,
System.Windows.Forms (527)
System\Windows\Forms\ActiveX\AxHost.cs (10)
1076Point phm = new(sz.Width, sz.Height); 1090PointF pcont = new(sz.Width, sz.Height); 1189height = adjustedSize.Height; 1219height = p.Height; 1416b.Height = p.Height; 3257if (setExtent.Width < ocxExtent.Width || setExtent.Height < ocxExtent.Height) 3259Bounds = new Rectangle(location.X, location.Y, ocxExtent.Width, ocxExtent.Height); 3263Size newSize = SetExtent(setExtent.Width, setExtent.Height); 3266Bounds = new Rectangle(location.X, location.Y, newSize.Width, newSize.Height);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (6)
489PInvoke.SetWindowExtEx(hdcDraw, sWindowExt.Width, sWindowExt.Height, lpsz: null); 491PInvoke.SetViewportExtEx(hdcDraw, sViewportExt.Width, sViewportExt.Height, lpsz: null); 700Point pt = PixelToHiMetric(size.Width, size.Height); 1692Size size = new(HiMetricToPixel(pSizel->Width, pSizel->Height)); 1703Size adjusted = new(size.Width, size.Height); 1705bounds.Height = adjusted.Height;
System\Windows\Forms\Control.cs (7)
359_height = defaultSize.Height; 1177set => SetClientSizeCore(value.Width, value.Height); 3014set => SetBounds(_x, _y, value.Width, value.Height, BoundsSpecified.Size); 5185return ApplyBoundsConstraints(0, 0, proposedSize.Width, proposedSize.Height).Size; 9786SetBoundsCore(rawScaledBounds.X, rawScaledBounds.Y, scaledSize.Width, scaledSize.Height, BoundsSpecified.All); 9841size.Height = (int)Math.Round(size.Height * y); 10655return _width != s.Width || _height != s.Height;
System\Windows\Forms\Control.MetafileDCWrapper.cs (2)
33if (size.Width < 0 || size.Height < 0) 44_hBitmap = PInvokeCore.CreateBitmap(size.Width, size.Height, (uint)planes, (uint)bitsPixel, lpBits: null);
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (2)
950if (proposedSize.Height == 1) 1183ShowToolTip = (ClientRectangle.Width < preferredSize.Width || ClientRectangle.Height < preferredSize.Height);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (9)
123xCompose(vComposition, checkSize.Height, imageSize.Height, textSize.Height)); 154xDecompose(vComposition, checkSize.Height, imageSize.Height, proposedSize.Height)); 499size = new Size(size.Width + 1, size.Height + 1); 604if (textImageRelation == TextImageRelation.ImageAboveText && layout.ImageBounds.Size.Height != 0) 671screen.Graphics.MeasureString(Text, Font, new SizeF(proposedSize.Width, proposedSize.Height),
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
288size.Height = Math.Max(size.Height + 5, _flatSystemStyleMinimumHeight);
System\Windows\Forms\Controls\Buttons\RadioButton.cs (2)
260? Math.Max(size.Height + 5, _flatSystemStyleMinimumHeight) 261: size.Height + 5;
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (9)
775_prefHeightCache = (short)(textSize.Height + SystemInformation.BorderSize.Height * 8 + Padding.Size.Height); 792_prefHeightCache = (short)(textSize.Height * itemCount + SystemInformation.BorderSize.Height * 16 + Padding.Size.Height); 825int dyEdit = textExtent.Height + SystemInformation.Border3DSize.Height; 837cyCombo = 2 * fixedFrameBoderSize.Height + dyEdit;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (13)
402: dataGridViewCell.GetPreferredSize(rowIndex).Height; 479: dataGridViewCell.GetPreferredSize(rowIndex).Height; 1762: TopLeftHeaderCell.GetPreferredSize(-1).Height; 1772: Math.Max(preferredHeight, Columns[columnIndex].HeaderCell.GetPreferredSize(-1).Height); 1827: TopLeftHeaderCell.GetPreferredSize(-1).Height; 1837: Math.Max(preferredHeight, Columns[columnIndexTmp].HeaderCell.GetPreferredSize(-1).Height); 5790&& Math.Abs(dgvcme.Y - _lastMouseClickInfo.Y) <= hotDoubleClickZone.Height / 2) 8983int bordersAndPaddingHeight = 2 * (BorderWidth + Padding.Size.Height); 9016int preferredHeight = Math.Min(minimumHeight + Rows.GetRowsHeight(DataGridViewElementStates.Visible), proposedConstraints.Height); 12704|| Math.Abs(_ptMouseDownGridCoord.Y - ptGridCoord.Y) >= s_dragSize.Height) 18821Invalidate(new Rectangle(new Point(-pt.X, ColumnHeadersHeight), new Size(-step, ClientSize.Height))); 18832new Size(step, ClientSize.Height))); 18846new Size(ClientSize.Width, ClientSize.Height - (pt.Y - rect.Bottom) - step)));
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (6)
324constraintSize.Height - borderAndPaddingHeights - marginHeights - 2 * DATAGRIDVIEWBUTTONCELL_verticalTextMargin > 0) 331constraintSize.Height - borderAndPaddingHeights - marginHeights - 2 * DATAGRIDVIEWBUTTONCELL_verticalTextMargin, 367flags).Height); 404preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight); 757valBounds.Inflate(-SystemInformation.Border3DSize.Width, -SystemInformation.Border3DSize.Height); 885valBounds.Height > 2 * SystemInformation.Border3DSize.Height + 1)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (13)
1683if (constraintSize.Width < 0 || constraintSize.Height < 0) 1690if (constraintSize.Height == 0) 1701if (constraintSize.Height == 0) 2290return GetPreferredSize(screen, dataGridViewCellStyle, rowIndex, new Size(width, 0)).Height; 2330return size.Height; 2554return requiredSize.Height; 2580if (textOneLineSize.Width / textOneLineSize.Height <= maxRatio) 2586float maxWidth = textOneLineSize.Width * textOneLineSize.Width / (float)textOneLineSize.Height / maxRatio * 1.1F; 2592if (textSize.Width / textSize.Height <= maxRatio || textSize.Width > (int)maxWidth) 2634if (oneLineSize.Height >= maxHeight || (flags & TextFormatFlags.SingleLine) != 0) 2648if (textSize.Height > maxHeight || textSize.Width > (int)maxWidth) 2659Debug.Assert(textSize.Height <= maxHeight); 3957return requiredHeight <= maxBounds.Height && !widthTruncated;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (15)
682preferredSize = new Size(0, checkBoxSize.Height + borderAndPaddingHeights + 2 * DATAGRIDVIEWCHECKBOXCELL_margin); 689checkBoxSize.Height + borderAndPaddingHeights + 2 * DATAGRIDVIEWCHECKBOXCELL_margin); 749preferredSize.Height = Math.Max(preferredSize.Height, 1199if (valBounds.Width >= checkBoxSize.Width && valBounds.Height >= checkBoxSize.Height && (paint || computeContentBounds)) 1220checkBoxY = valBounds.Bottom - checkBoxSize.Height; 1224checkBoxY = valBounds.Top + (valBounds.Height - checkBoxSize.Height) / 2; 1237new Rectangle(checkBoxX, checkBoxY, checkBoxSize.Width, checkBoxSize.Height), 1241resultBounds = new Rectangle(checkBoxX, checkBoxY, checkBoxSize.Width, checkBoxSize.Height); 1256checkBoxSize.Height, 1266checkBoxSize.Height, 1271resultBounds = new Rectangle(checkBoxX, checkBoxY, checkBoxSize.Width, checkBoxSize.Height); 1278Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.Width, checkBoxSize.Height); 1336Rectangle fullSize = new(checkBoxX - 1, checkBoxY - 1, checkBoxSize.Width + 3, checkBoxSize.Height + 3); 1384Rectangle checkBounds = new(checkBoxX, checkBoxY, checkBoxSize.Width - 1, checkBoxSize.Height - 1); 1548Debug.Assert(valBounds.Width < checkBoxSize.Width || valBounds.Height < checkBoxSize.Height, "the bounds are empty");
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (8)
521Math.Max(1, constraintSize.Height - borderAndPaddingHeights - 2 * VerticalMargin), 537if (constraintSize.Height - borderAndPaddingHeights - 2 * VerticalMargin > s_sortGlyphHeight && 618flags).Height); 622preferredSize.Height = Math.Max(preferredSize.Height, glyphSize.Height); 623preferredSize.Height = Math.Max(preferredSize.Height, 1); 664preferredSize.Height = Math.Max(preferredSize.Height, s_sortGlyphHeight); 668preferredSize.Height = Math.Max(preferredSize.Height, 1);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
538size.Height - borderAndPaddingWidths.Y - borderAndPaddingWidths.Height); 543dropHeight = Math.Min(GetDropDownButtonHeight(screen, cellStyle), adjustedSize.Height - 2); 1222preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (3)
463int imgHeightAllowed = constraintSize.Height - borderAndPaddingHeights; 475int icoHeightAllowed = constraintSize.Height - borderAndPaddingHeights; 532preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (3)
568int maxHeight = constraintSize.Height - borderAndPaddingHeights - VerticalTextMarginTop - VerticalTextMarginBottom; 626MeasureTextSize(graphics, formattedString, cellStyle.Font!, flags).Height); 663preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (2)
1302preferredRowThickness = Math.Max(preferredRowThickness, HeaderCell.GetPreferredSize(rowIndex).Height); 1320preferredCellThickness = dataGridViewCell.GetPreferredSize(rowIndex).Height;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (4)
214preferredHeight = txtEditingControl.PreferredSize.Height; 425Math.Max(1, constraintSize.Height - borderAndPaddingHeights - DATAGRIDVIEWTEXTBOXCELL_verticalTextMarginTopWithWrapping - DATAGRIDVIEWTEXTBOXCELL_verticalTextMarginBottom), 472MeasureTextSize(graphics, formattedString, cellStyle.Font!, flags).Height); 501preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + IconMarginHeight * 2 + s_iconsHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (12)
168int preferredWidth = 0, allowedHeight = constraintSize.Height - borderAndPaddingHeights; 241minHeightContent = DataGridViewCell.MeasureTextSize(graphics, val, cellStyle.Font!, flags).Height; 293preferredSize.Height = Math.Max(preferredSize.Height, 336if (sizeConstraint.Height > sizeCell.Height) 338sizeConstraint.Height = sizeCell.Height; 408ptTextLocation.Y = cellBounds.Y + (cellBounds.Height - sizeText.Height) / 2; 413ptTextLocation.Y = cellBounds.Y + (cellBounds.Height - sizeText.Height) / 2; 418ptTextLocation.Y = cellBounds.Y + (cellBounds.Height - sizeText.Height) / 2; 423ptTextLocation.Y = cellBounds.Bottom - sizeText.Height; 428ptTextLocation.Y = cellBounds.Bottom - sizeText.Height; 433ptTextLocation.Y = cellBounds.Bottom - sizeText.Height;
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
750height += SystemInformation.BorderSize.Height * 4 + 3;
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
167Math.Max(size.Height - _fontHeight - padding.Vertical, 0));
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (2)
189textBounds.Height = measuredBounds.Height; 292textBounds.Height = measuredBounds.Height;
System\Windows\Forms\Controls\ImageList\ImageList.cs (14)
162if (value.Height <= 0 || value.Height > s_maxImageHeight) 164throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(SR.InvalidBoundArgument, "ImageSize.Height", value.Height, 1, s_maxImageHeight)); 167if (_imageSize.Width != value.Width || _imageSize.Height != value.Height) 169_imageSize = new Size(value.Width, value.Height); 328if (size.Height != _imageSize.Height) 516public void Draw(Graphics g, int x, int y, int index) => Draw(g, x, y, _imageSize.Width, _imageSize.Height, index); 627int offset = bmpData.Stride * _imageSize.Height * index; 631result = new Bitmap(_imageSize.Width, _imageSize.Height, PixelFormat.Format32bppArgb); 632targetData = result.LockBits(new Rectangle(0, 0, _imageSize.Width, _imageSize.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); 659result = new Bitmap(_imageSize.Width, _imageSize.Height); 674_imageSize.Height,
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (1)
399if (value.Height != _owner.ImageSize.Height)
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (1)
38himl = PInvoke.ImageList_Create(imageSize.Width, imageSize.Height, flags, InitialCapacity, GrowBy);
System\Windows\Forms\Controls\Labels\Label.cs (9)
642public virtual int PreferredHeight => PreferredSize.Height; 891yLoc = (r.Y + r.Height - 4) - pointImageSize.Height; 899yLoc = r.Y + (r.Height - pointImageSize.Height) / 2; 902return new Rectangle(xLoc, yLoc, pointImageSize.Width, pointImageSize.Height); 1039if (proposedSize.Height == 1) 1083new SizeF(0, proposedConstraints.Height) : 1084new SizeF(proposedConstraints.Width, proposedConstraints.Height); 1273_showToolTip = (clientRect.Width < preferredSize.Width || clientRect.Height < preferredSize.Height); 1395height = preferredSize.Height;
System\Windows\Forms\Controls\Labels\LinkLabel.cs (4)
584textSize.Height); 988_showToolTip = clientRect.Width < preferredSize.Width || clientRect.Height < preferredSize.Height; 1075if (requiredSize.Height < focusRectangle.Height) 1077focusRectangle.Height = requiredSize.Height;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (3)
604Size = new Size(oldSize.Width + 1, oldSize.Height); 750height += SystemInformation.BorderSize.Height * 4 + 3; 2327Rectangle rect = new(0, 0, Size.Width - 1, Size.Height - 1);
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (1)
106resultBounds = new Rectangle(originalBounds.X, originalBounds.Y, textSize.Width, textSize.Height);
System\Windows\Forms\Controls\ListView\ListView.cs (2)
1670if (value.Height <= 0 || value.Width <= 0) 6899Rectangle rect = new(0, 0, Size.Width - 1, Size.Height - 1);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (8)
282SetCalendarDimensions(value.Width, value.Height); 1199int todayHeight = textExtent.Height + 4; // The constant 4 is from the comctl32 MonthCalendar source code 1200int calendarHeight = minSize.Height; 1235minSize.Height = (calendarHeight + InsertHeightSize) * _dimensions.Height - InsertHeightSize + todayHeight; 1279return preferredSize.Height; 1673if (height > max.Height) 1675height = max.Height; 1785if (_dimensions.Width != x || _dimensions.Height != y)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (2)
368float ratio = Math.Min(ClientRectangle.Width / (float)imageSize.Width, ClientRectangle.Height / (float)imageSize.Height); 370result.Height = (int)(imageSize.Height * ratio);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
4108if (e.Y <= 1 || (size.Height - e.Y) <= 1)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.cs (1)
62return new Rectangle(4, 4, size.Width - 8, size.Height - 8);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (5)
79int height = _titleLabel.Size.Height; 93height += (size.Height * 2) + padding; 152size.Height = Math.Max(0, size.Height - 2 * _borderSize); 158Math.Min(_lineHeight, size.Height), 165Math.Max(0, size.Height - _lineHeight - (ScaleHelper.IsScalingRequirementMet ? LogicalToDeviceUnits(1) : 1)),
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (17)
951return new Bitmap(size.Width, size.Height); 1428if (rectScreen.Y + rectScreen.Height < (size.Height + location.Y + EditTextBox.Height)) 1430location.Y -= size.Height; 1454_dropDownHolder.SetBounds(location.X, location.Y, size.Width, size.Height); 1864size.Height = sizeWindow.Height; 1975boundsScroll.Height = sizeWindow.Height - 2; 2006rect.Height = Size.Height - rect.Y - 1; 2121Invalidate(new Rectangle(left, 0, Size.Width - left, Size.Height)); 2210if ((Size.Width > doubleOffset) && (Size.Height > doubleOffset)) 2213ControlPaint.DrawFocusRectangle(g, new Rectangle(_offset2Units, _offset2Units, Size.Width - doubleOffset, Size.Height - doubleOffset)); 2359Rectangle clearRect = new(1, 1, Size.Width - 2, Size.Height - 2); 2597Math.Abs(screenPoint.Y - _rowSelectPos.Y) < SystemInformation.DoubleClickSize.Height) 3347if (yPosition < Size.Height) 3350Rectangle clearRect = new(1, yPosition, Size.Width - 2, Size.Height - yPosition - 1); 3358g.DrawRectangle(borderPen, 0, 0, sizeWindow.Width - 1, sizeWindow.Height - 1); 4208int maxRows = (int)Math.Ceiling(((double)GetOurSize().Height) / (1 + RowHeight)); 4423_visibleRows = (int)Math.Ceiling(((double)size.Height) / (1 + RowHeight));
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (2)
435newBounds.Height = Math.Max(s_minDropDownSize.Height, _dragBaseRect.Height + (dragPoint.Y - _dragStart.Y)); 445if ((_dragBaseRect.Height - delta) > s_minDropDownSize.Height)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
676_maxSize = clientSize.Height - dockHeight - _minExtra;
System\Windows\Forms\Controls\TabControl\TabControl.cs (3)
520if (value.Width < 0 || value.Height < 0) 939PInvokeCore.SendMessage(this, PInvoke.TCM_SETITEMSIZE, 0, PARAM.FromLowHigh(_itemSize.Width, _itemSize.Height)); 1521Size = new Size(size.Width + 1, size.Height);
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (1)
2899Rectangle rect = new(0, 0, Size.Width - 1, Size.Height - 1);
System\Windows\Forms\Controls\TextBox\TextBox.cs (1)
826Rectangle rect = new(0, 0, Size.Width - 1, Size.Height - 1);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (2)
803height += SystemInformation.GetBorderSizeForDpi(_deviceDpi).Height * 4 + 3; 853textSize.Height = Math.Max(textSize.Height, FontHeight);
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (3)
25|| _cachedHDCSize.Height < bitmapSize.Height) 34_cachedItemBitmap = PInvokeCore.CreateCompatibleBitmap(toolStripHDC, bitmapSize.Width, bitmapSize.Height);
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (7)
90return new Padding(1, 3, 1, DefaultSize.Height); 212int gripHeight = Math.Min(DefaultSize.Height, statusStripSize.Height); 216return new Rectangle(0, statusStripSize.Height - gripHeight, GripWidth, gripHeight); 220return new Rectangle(statusStripSize.Width - GripWidth, statusStripSize.Height - gripHeight, GripWidth, gripHeight); 304if (proposedSize.Height == 1) 376noMansLand.Y += ClientSize.Height + 1;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (8)
2243if (proposedSize.Height == 1) 2274maxSize.Height = Math.Max(0, defaultSize.Height); 2291maxSize.Height = Math.Max(maxSize.Height, itemMargin.Vertical + prefItemSize.Height); 2349maxSize.Height += itemMargin.Vertical + preferredSize.Height; 3556item.Size.Height, 3574item.Size.Height, 4508cursorLocation.Y += Cursor.Size.Height - currentCursor.HotSpot.Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (2)
77int heightOfDropDown = s_dropDownArrowSize.Height + _dropDownArrowPadding.Vertical; 82_dropDownArrowRect = new Rectangle(0, options.Client.Bottom + _dropDownArrowPadding.Top, _ownerItem.Bounds.Width - 1, s_dropDownArrowSize.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (24)
299menuItemTextSize.Height = Math.Max(menuItemTextSize.Height, shortcutTextSize.Height); 304maxTextSize.Height = Math.Max(maxTextSize.Height, menuItemTextSize.Height); 314maxImageSize.Height = Math.Max(maxImageSize.Height, imageSize.Height); 320maxCheckSize.Height = Math.Max(checkedImageSize.Height, maxCheckSize.Height); 325maxNonMenuItemSize.Height = Math.Max(item.Bounds.Height, maxNonMenuItemSize.Height); 330_maxItemSize.Height = Math.Max(maxTextSize.Height + _textPadding.Vertical, Math.Max(maxCheckSize.Height + _checkPadding.Vertical, maxArrowSize.Height + _arrowPadding.Vertical)); 335_maxItemSize.Height = Math.Max(maxImageSize.Height + _imagePadding.Vertical, _maxItemSize.Height); 339maxArrowSize = new Size(_arrowSize, _maxItemSize.Height); 341maxTextSize.Height = _maxItemSize.Height - _textPadding.Vertical; 342maxImageSize.Height = _maxItemSize.Height - _imagePadding.Vertical; 343maxCheckSize.Height = _maxItemSize.Height - _checkPadding.Vertical; 364_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, maxCheckSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter); 369_imageRectangle = LayoutUtils.Align(maxImageSize, new Rectangle(nextPoint.X, nextPoint.Y, maxImageSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter); 380_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth, _maxItemSize.Height), ContentAlignment.MiddleCenter); 399_checkRectangle = LayoutUtils.Align(LayoutUtils.UnionSizes(maxCheckSize, maxImageSize), new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth - 1, _maxItemSize.Height), ContentAlignment.MiddleCenter); 454_maxItemSize.Height += _maxItemSize.Height % 2; 803Point downLocation = new(1, height - downSize.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (4)
96if (preferredSize.Height > constrainingSize.Height) 98preferredSize.Height = constrainingSize.Height; 149if (deltaY >= s_dragSize.Height)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (1)
82preferredSize.Height = Math.Min(constrainingSize.Height, s_maxSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (9)
160if (MaximumSize.Height >= Control.PreferredSize.Height) 169if (MaximumSize.Height + growBy >= Control.PreferredSize.Height) 171int freed = Control.PreferredSize.Height - MaximumSize.Height; 179if (MaximumSize.Height + growBy < Control.PreferredSize.Height) 280preferredSize.Height = constrainingSize.Height;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (4)
561if (cachedBounds.Height > minSize.Height) 563spaceToFree -= (cachedBounds.Height - minSize.Height); 565cachedBounds.Height = (spaceToFree < 0) ? minSize.Height + -spaceToFree : minSize.Height;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (2)
94return totalSize.Height < DisplayRectangle.Height; 444int controlToDragWidth = (toolStripToDrag.AutoSize) ? toolStripToDrag.PreferredSize.Height : toolStripToDrag.Height;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (4)
878using Bitmap textBmp = new(textSize.Width, textSize.Height, PixelFormat.Format32bppPArgb); 1036Bitmap disabledBitmap = new(size.Width, size.Height); 1040new Rectangle(0, 0, size.Width, size.Height), 10410, 0, size.Width, size.Height,
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
282return new Size(SeparatorThickness, constrainingSize.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (17)
137int overflowWidth = (OverflowRequired) ? OverflowButtonSize.Height : 0; 139currentHeight += itemSize.Height + item.Margin.Vertical; 194_noMansLand.Y += ToolStrip.ClientSize.Height + 1; 301alignedRightItems = (alignedRightItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height) 302: Rectangle.Union(alignedRightItems, new Rectangle(x, y, itemSize.Width, itemSize.Height)); 314alignedLeftItems = (alignedLeftItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height) 315: Rectangle.Union(alignedLeftItems, new Rectangle(x, y, itemSize.Width, itemSize.Height)); 377bool needOverflow = toolStrip.CanOverflow && ((OverflowRequired) || (OverflowSpace >= OverflowButtonSize.Height)); 436y = lastBottom - (itemMargin.Bottom + itemSize.Height); 438alignedRightItems = (alignedRightItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height) 439: Rectangle.Union(alignedRightItems, new Rectangle(x, y, itemSize.Width, itemSize.Height)); 445lastTop = y + itemSize.Height + itemMargin.Bottom; 446alignedLeftItems = (alignedLeftItems == Rectangle.Empty) ? new Rectangle(x, y, itemSize.Width, itemSize.Height) 447: Rectangle.Union(alignedLeftItems, new Rectangle(x, y, itemSize.Width, itemSize.Height)); 591freedSpace += (horizontal) ? itemSize.Width + itemMargin.Horizontal : itemSize.Height + itemMargin.Vertical; 600spaceNeeded += (horizontal) ? OverflowButtonSize.Width : OverflowButtonSize.Height; 604OverflowSpace += (horizontal) ? itemSize.Width + itemMargin.Horizontal : itemSize.Height + itemMargin.Vertical;
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (2)
786int maxTickCount = (Orientation == Orientation.Horizontal ? Size.Width : Size.Height) / 2; 1146int size = Orientation == Orientation.Horizontal ? Size.Width : Size.Height;
System\Windows\Forms\Controls\TreeView\TreeNode.cs (1)
632visible = (rc.bottom > 0 && rc.right > 0 && rc.top < size.Height && rc.left < size.Width);
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
3151Rectangle rect = new(0, 0, Size.Width - 1, Size.Height - 1);
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
344height += SystemInformation.BorderSize.Height * 4 + 3;
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (3)
59int half_height = Size.Height / 2; 259int half_height = ClientSize.Height / 2; 318if (half_height != (ClientSize.Height + 1) / 2)
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (2)
201ResizeTo(value.Width, value.Height); 392htmlWindow.Value->resizeTo(size.Width, size.Height).ThrowOnFailure();
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (4)
788extent = SetExtent(extent.Width, extent.Height); 791Bounds = new Rectangle(location.X, location.Y, extent.Width, extent.Height); 1112Point phm = new(sz.Width, sz.Height); 1125PointF pcont = new(sz.Width, sz.Height);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.WebBrowserBaseNativeWindow.cs (1)
53wp->cy = s.Height;
System\Windows\Forms\Design\ComponentEditorForm.cs (4)
236_maxSize.Width, _maxSize.Height); 357if (pageSize.Height > _maxSize.Height) 359_maxSize.Height = pageSize.Height;
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (2)
128rc2.top = rc.top + (((rc.bottom - rc.top) - size.Height) >> 1); 129rc2.bottom = rc2.top + size.Height;
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (4)
228if (textSize.Height > _scaledMaxHeight) 234int buttonTop = Math.Max(textSize.Height, _scaledMaxTextHeight) + _scaledPaddingHeight; 265_scaledMessageTopPadding + (_scaledMaxTextHeight - Math.Min(textSize.Height, _scaledMaxTextHeight)) / 2, 266textSize.Width, textSize.Height);
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.cs (3)
233y = _control.Top + (_control.Height - size.Height) / 2; 237y = _control.Bottom - size.Height; 241return new Rectangle(x, y, size.Width, size.Height);
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (3)
54using BufferScope<byte> bits = new(widthInBytes * size.Height); 59for (int y = 0; y < size.Height; y++) 72_region.Intersect(new Rectangle(0, 0, size.Width, size.Height));
System\Windows\Forms\Form.cs (44)
1198if (value.Width < 0 || value.Height < 0) 1223if (minimumSize.Height > value.Height) 1225minimumSize.Height = value.Height; 1241if (!value.IsEmpty && (size.Width > value.Width || size.Height > value.Height)) 1243Size = new Size(Math.Min(size.Width, value.Width), Math.Min(size.Height, value.Height)); 1311if (value.Width < 0 || value.Height < 0) 1340if (maximumSize.Height < value.Height) 1342maximumSize.Height = value.Height; 1358if (size.Width < value.Width || size.Height < value.Height) 1360Size = new Size(Math.Max(size.Width, value.Width), Math.Max(size.Height, value.Height)); 1373Size.Height, 2992float percY = AdjustScale(newVar.Height / ((float)baseVar.Height)); 3071bounds.Height = correct.Height; 3081if (correctClientSize.Height != currentClient.Height) 3083int delta = correctClientSize.Height - currentClient.Height; 3622cp.Height = correct.Height; 3870p.Y = (ownerRect.top + ownerRect.bottom - s.Height) / 2; 3875else if (p.Y + s.Height > screenRect.Y + screenRect.Height) 3877p.Y = screenRect.Y + screenRect.Height - s.Height; 4212form.SetBounds(new Rectangle(Left, Top, adjustedSize.Width, adjustedSize.Height), BoundsSpecified.None); 4411new Rectangle(size.Width - SizeGripSize, size.Height - SizeGripSize, SizeGripSize, SizeGripSize)); 4419size.Height - SizeGripSize, 4552desiredSize.Height = (int)(Size.Height * autoScaleFactor.Height); 4579size->cy = desiredSize.Height; 5012_formStateEx[s_formStateExWindowBoundsHeightIsClientSize] == 1 ? restoredSize.Height : _restoredWindowBounds.Height, 5228if (height > max.Height) 5230height = max.Height; 5248if (height < min.Height) 5250height = min.Height; 5309if (x != ClientSize.Width || y != ClientSize.Height) 6781mmi->ptMinTrackSize.Y = minTrack.Height; 6796if (minTrack.Height > virtualScreen.Height) 6813mmi->ptMaxTrackSize.Y = Math.Max(maxTrack.Height, minTrackWindowSize.Height); 6911point.Y >= (clientSize.Height - SizeGripSize) && 6912clientSize.Height >= SizeGripSize)
System\Windows\Forms\Input\Cursor.cs (9)
225return (nint)PInvokeCore.CopyCursor(this, sz.Width, sz.Height, IMAGE_FLAGS.LR_DEFAULTCOLOR); 280imageHeight = cursorSize.Height; 293targetHeight = cursorSize.Height; 304&& imageWidth == cursorSize.Width && imageHeight == cursorSize.Height) 311drawHeight = cursorSize.Height * targetHeight / imageHeight; 319&& cursorSize.Width <= targetWidth && cursorSize.Height <= targetHeight 320&& cursorSize.Width == imageWidth && cursorSize.Height == imageHeight) 327drawHeight = cursorSize.Height; 425picSize.Height,
System\Windows\Forms\Layout\CommonProperties.cs (2)
208bounds.Height = Math.Min(bounds.Height, value.Height); 232bounds.Height = Math.Max(bounds.Height, value.Height);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (2)
1266if (DesignMode && Height != DefaultSize.Height && value + Panel2MinSize + SplitterWidth > Height) 1295if (DesignMode && Height != DefaultSize.Height && value + Panel1MinSize + SplitterWidth > Height)
System\Windows\Forms\Layout\DefaultLayout.cs (22)
58if (bounds.Width < prefSize.Width || bounds.Height < prefSize.Height) 84Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || (newSize.Height >= oldBounds.Height && newSize.Width >= oldBounds.Width), 96location.Y -= newSize.Height - oldBounds.Height; 401Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height); 414Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Bottom - elementSize.Height, elementSize.Width, elementSize.Height); 427Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height); 440Rectangle newElementBounds = new(remainingBounds.Right - elementSize.Width, remainingBounds.Y, elementSize.Width, elementSize.Height); 458Rectangle newElementBounds = new(remainingBounds.X, remainingBounds.Y, elementSize.Width, elementSize.Height); 556Size newSize = xGetDockedSize(element, /* constraints = */ new Size(1, remainingSize.Height)); 559newSize.Height = remainingSize.Height; 563newSize.Height = Math.Max(newSize.Height, remainingSize.Height); 566Debug.Assert((measureOnly && (newSize.Height >= remainingSize.Height)) || (newSize.Height == remainingSize.Height), 586Debug.Assert(desiredSize.Width >= 0 && desiredSize.Height >= 0, "Error detected in xGetDockSize: Element size was negative."); 1137prefSize.Height = Math.Max(prefSize.Height, elementSpace.Bottom); 1168prefSize.Height = Math.Max(prefSize.Height, anchorInfo is null ? bounds.Bottom : bounds.Bottom + anchorInfo.Bottom); 1173? Math.Max(prefSize.Height, elementSpace.Bottom + anchorDest.Height) 1174: Math.Max(prefSize.Height, anchorDest.Bottom);
System\Windows\Forms\Layout\FlowLayout.cs (12)
28if (prefSize.Width > proposedConstraints.Width || prefSize.Height > proposedConstraints.Height) 76Rectangle measureBounds = new(displayRect.X, displayRect.Y, displayRect.Width, displayRect.Height - layoutSize.Height); 87layoutSize.Height + displayRect.Y, 89rowSize.Height); 94layoutSize.Height += rowSize.Height; 187Size elementConstraints = new(int.MaxValue, rowBounds.Height - elementProxy.Margin.Size.Height); 212if (prefSize.Height < elementProxy.MinimumSize.Height) 214prefSize.Height = elementProxy.MinimumSize.Height; 253rowSize.Height = Math.Max(rowSize.Height, requiredSize.Height);
System\Windows\Forms\Layout\LayoutUtils.cs (32)
52largestSize.Height = Math.Max(largestSize.Height, textSize.Height); 131if (size.Height == 0) 209Math.Max(a.Height, b.Height)); 216Math.Min(a.Height, b.Height)); 326withinThis.Y += withinThis.Height - alignThis.Height; 330withinThis.Y += (withinThis.Height - alignThis.Height) / 2; 333withinThis.Height = alignThis.Height; 342withinThis.Y += withinThis.Height - alignThis.Height; 346withinThis.Y += (withinThis.Height - alignThis.Height) / 2; 349withinThis.Height = alignThis.Height; 358(anchorStyles & VerticalAnchorStyles) == VerticalAnchorStyles ? withinThis.Height : stretchThis.Height); 364if (stretchedSize.Height > withinThis.Height) 366stretchedSize.Height = withinThis.Height; 400currentSize.Height += contentSize.Height; 405currentSize.Height = Math.Max(currentSize.Height, contentSize.Height); 456(size.Height, size.Width) = (size.Width, size.Height); 495return (size.Width == 0 || size.Height == 0); 500return ((size1.Width >= size2.Width) && (size1.Height >= size2.Height)); 519region1.Height = specifiedContent.Height; 520region2.Y += specifiedContent.Height; 521region2.Height -= specifiedContent.Height; 524region1.Y += bounds.Height - specifiedContent.Height; 525region1.Height = specifiedContent.Height; 526region2.Height -= specifiedContent.Height; 579currentSize.Height -= contentSize.Height;
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (2)
63&& (sizeCache.PreferredSize.Height <= proposedConstraints.Height))
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (1)
374if (proposedConstraints.Height == 0 || proposedConstraints.Width == 0)
System\Windows\Forms\Layout\TableLayout.cs (10)
109containerSize.Height = Math.Max(containerSize.Height, 1); 166containerSize.Height = Math.Max(containerSize.Height, 1); 179proposedConstraints.Height = Math.Max(proposedConstraints.Height, 1); 231if (rows.Length != 0 && totalSpace.Height > usedSpace.Height) 233rows[^1].MinSize += totalSpace.Height - usedSpace.Height; 821if (dontHonorConstraint && (proposedConstraints.Height < short.MaxValue)) 856int minHeight = GetElementSize(element, new Size(currentWidth - margin.Horizontal, 0)).Height + margin.Vertical; 863return DistributeStyles(containerInfo.CellBorderWidth, containerInfo.RowStyles, containerInfo.Rows, proposedConstraints.Height, dontHonorConstraint);
System\Windows\Forms\OLE\DataObject.Composition.WinFormsToNativeAdapter.cs (2)
174HBITMAP compatibleBitmap = PInvokeCore.CreateCompatibleBitmap(screenDC, bitmap.Size.Width, bitmap.Size.Height); 183bitmap.Size.Height,
System\Windows\Forms\Printing\PrintPreviewControl.cs (19)
417internal double VerticalViewSize => InsideRectangle.Height * 100.0 / VirtualSize.Height; 487double zoomY = ((double)controlPhysicalSize.Height - Border * (_rows + 1)) / (_rows * pageSize.Height); 491_imageSize = new Size((int)(_zoom * pageSize.Width), (int)(_zoom * pageSize.Height)); 493int virtualY = (_imageSize.Height * _rows) + Border * (_rows + 1); 627Math.Max(0, (rect.Height - _virtualSize.Height) / 2)); 656double zoomY = ((double)controlPhysicalSize.Height - Border * (_rows + 1)) 657/ (_rows * pageSize.Height); 661_imageSize = new Size((int)(_zoom * pageSize.Width), (int)(_zoom * pageSize.Height)); 670maxImageHeight = Math.Max(maxImageHeight, imagePixels.Height); 672pageRenderArea[imageIndex - StartPage] = new Rectangle(x, y, imagePixels.Width, imagePixels.Height); 752new(PixelsToPhysical(pixels.Width, dpi.X), PixelsToPhysical(pixels.Height, dpi.Y)); 758new(PhysicalToPixels(physical.Width, dpi.X), PhysicalToPixels(physical.Height, dpi.Y)); 833virtualDimension: _virtualSize.Height, 855bool vertical = _virtualSize.Height > displaySize.Height && displaySize.Height > _hScrollBar.Height; 864vertical = _virtualSize.Height > (displaySize.Height - _hScrollBar.Height);
System\Windows\Forms\Rendering\ControlPaint.cs (17)
101float yRatio = bounds.Height / (float)imageSize.Height; 109result.Height = (int)((imageSize.Height * xRatio) + .5); 226graphics.FillRectangle(brush, 0, 0, size.Width, size.Height); 227graphics.DrawImage(bitmap, 0, 0, size.Width, size.Height); 295return (IntPtr)PInvokeCore.CreateBitmap(size.Width, size.Height, nPlanes: 1, nBitCount: 1, pBits); 323PInvokeCore.BitBlt(targetDC, x: 0, y: 0, size.Width, size.Height, sourceDC, x1: 0, y1: 0, (ROP_CODE)0x220326); 1040rc.top -= sz.Height; 1041rc.bottom += sz.Height; 1513if (pixelsBetweenDots.Width <= 0 || pixelsBetweenDots.Height <= 0) 1520|| s_gridSize.Height != pixelsBetweenDots.Height || invert != s_gridInvert) 1535int height = ((idealSize / pixelsBetweenDots.Height) + 1) * pixelsBetweenDots.Height; 1542for (int y = 0; y < height; y += pixelsBetweenDots.Height) 1641new Rectangle(0, 0, imageSize.Width, imageSize.Height), 16420, 0, imageSize.Width, imageSize.Height, 16540, 0, imageSize.Width, imageSize.Height,
System\Windows\Forms\Rendering\TextExtensions.cs (2)
239if (proposedSize.Height <= 0) 252if (proposedSize.Height == int.MaxValue && dt.HasFlag(DRAW_TEXT_FORMAT.DT_SINGLELINE))
System\Windows\Forms\Scrolling\ScrollableControl.cs (12)
103if (value.Width < 0 || value.Height < 0) 108SetAutoScrollMargin(value.Width, value.Height); 221if (AutoScrollMinSize.Width != 0 && AutoScrollMinSize.Height != 0) 224displayRectangle.Height = Math.Max(displayRectangle.Height, AutoScrollMinSize.Height); 365_scrollMargin.Height += current.Size.Height; 378maxY = _userAutoScrollMinSize.Height + _scrollMargin.Height; 394if (layoutBounds.Height > maxY) 397maxY = layoutBounds.Height; 462int ctlBottom = -display.Y + bounds.Y + bounds.Height + _scrollMargin.Height; 858int yMargin = _scrollMargin.Height; 963if (x != _requestedScrollMargin.Width || y != _requestedScrollMargin.Height)
System\Windows\Forms\SystemInformation.cs (1)
462return new Rectangle(0, 0, size.Width, size.Height);
System\Windows\Forms\ToolTip\ToolTip.cs (8)
1495Point optimalPoint = GetOptimalToolTipPosition(tool, toolRectangle, bubbleSize.Width, bubbleSize.Height); 1944if (moveToLocation.Y + tipSize.Height > screen.WorkingArea.Bottom) 1946moveToLocation.Y = screen.WorkingArea.Bottom - tipSize.Height; 1955tipSize.Height, 2074if (rect.Height > currentTooltipSize.Height) 2113currentTooltipSize.Height, 2187if (wp->y + wp->cy + currentCursor.Size.Height - currentCursor.HotSpot.Y > screen.WorkingArea.Bottom) 2193wp->y = cursorPos.Y + currentCursor.Size.Height - currentCursor.HotSpot.Y;
System.Windows.Forms.Design (141)
System\ComponentModel\Design\ByteViewer.cs (1)
549int rows = (ClientSize.Height - 2 * (BORDER_GAP + INSET_GAP)) / CELL_HEIGHT;
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
575button.Inflate(-SystemInformation.BorderSize.Width * 2, -SystemInformation.BorderSize.Height * 2);
System\ComponentModel\Design\DesignerActionPanel.cs (9)
256if (rectangleAnchor.Bottom + sizePanel.Height > rectScreen.Bottom) 259if (rectangleAnchor.Top - sizePanel.Height < rectScreen.Top) 268if (rectangleAnchor.Top - sizePanel.Height < rectScreen.Top) 271if (rectangleAnchor.Bottom + sizePanel.Height > rectScreen.Bottom) 301y = rectangleAnchor.Top - sizePanel.Height - EDGE_SPACE; 319y = rectangleAnchor.Bottom - sizePanel.Height; 337y = rectangleAnchor.Top - sizePanel.Height - EDGE_SPACE; 382_lineHeights.Add(size.Height); 383yPos += size.Height;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (6)
176int buttonHeight = EditRegionSize.Height - EditorLineButtonPadding * 2 - 1; 291int width = EditRegionSize.Height - EditorLineSwatchPadding * 2; 353if (rectScreen.Bottom < (dropDownSize.Height + editorLocation.Y + editorBounds.Height)) 355editorLocation.Y -= dropDownSize.Height + 1; 377if (rectScreen.Bottom < (dropDownSize.Height + editorLocation.Y + editorBounds.Height)) 379editorLocation.Y -= dropDownSize.Height + 1;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
37int height = Math.Max(_hostedControl.Height, SystemInformation.MinimizedWindowSize.Height);
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (4)
68_subtitleLabel.Location = new Point(LineLeftMargin, top + PanelHeaderVerticalPadding * 2 + titleSize.Height); 73int newHeight = (subtitleSize.IsEmpty ? (titleSize.Height + 2 * PanelHeaderVerticalPadding) : (titleSize.Height + subtitleSize.Height + 3 * PanelHeaderVerticalPadding));
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (2)
94int textBoxPreferredHeight = _textBox.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)).Height; 116EditControl.Height = _editRegionSize.Height - TextBoxLineInnerPadding * 2 - 1;
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (2)
169if (Size.Width != ctrl.Size.Width || Size.Height != ctrl.Size.Height)
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (2)
173ClientSize = new Size(ClientSize.Width + requestedDelta, MinimumSize.Height); 417new RectangleF(0.0f, 0.0f, ClientSize.Width, ClientSize.Height),
System\Drawing\Design\ColorEditor.ColorUI.cs (2)
89Size = new Size(size.Width + 2 * CMARGIN, size.Height + 2 * CMARGIN + rectItemSize.Height); 316_pal.Size.Height - rectItemSize.Height + 2 * CMARGIN);
System\Drawing\Design\CursorEditor.CursorUI.cs (1)
23ItemHeight = Math.Max(4 + Cursors.Default.Size.Height, Font.Height);
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (1)
73int YBORDER = SystemInformation.Border3DSize.Height;
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (2)
178if (delta.Width >= DesignerUtils.MinDragSize.Width / 2 || delta.Height >= DesignerUtils.MinDragSize.Height / 2)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (3)
147int yDelta = controlLocation.Y % _parentGridSize.Height; 158if (yDelta > _parentGridSize.Height / 2) 160offset.Y = _parentGridSize.Height - yDelta;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (10)
123int yDelta = controlBounds.Bottom % _parentGridSize.Height; 124if (yDelta > _parentGridSize.Height / 2) 126rect.Height += _parentGridSize.Height - yDelta; 135int yDelta = controlBounds.Top % _parentGridSize.Height; 136if (yDelta > _parentGridSize.Height / 2) 138rect.Y += _parentGridSize.Height - yDelta; 139rect.Height -= _parentGridSize.Height - yDelta; 150rect.Height = Math.Max(rect.Height, _parentGridSize.Height); 492if (Math.Abs(_initialPoint.X - mouseLoc.X) > DesignerUtils.MinDragSize.Width / 2 || Math.Abs(_initialPoint.Y - mouseLoc.Y) > DesignerUtils.MinDragSize.Height / 2) 549int minHeight = Math.Max(targetControl.MinimumSize.Height, MINSIZE);
System\Windows\Forms\Design\CommandSet.cs (31)
855moveOffsetY *= snapSize.Height; 1043loc.Y = primaryLocation.Y + primarySize.Height - size.Height; 1051loc.Y = primarySize.Height / 2 + primaryLocation.Y - size.Height / 2; 1199delta = loc.Y % gridSize.Height; 1200if (delta < (gridSize.Height / 2)) 1206loc.Y += (gridSize.Height - delta); 1308if (loc.Y + size.Height > bottom) 1309bottom = loc.Y + size.Height; 1324int centerOfParentY = (viewParent.ClientSize.Height) / 2; 2348itemSize.Height = primarySize.Height; 2431size.Height = ((size.Height + (grid.Height / 2)) / grid.Height) * grid.Height; 2433loc.Y = (loc.Y / grid.Height) * grid.Height; 2617total += curSize.Height; 2703: (lastSize.Height + lastLoc.Y - curLoc.Y - total) / (selectedObjects.Length - 1); 2833curLoc.Y = lastLoc.Y + lastSize.Height; 2839curLoc.Y -= grid.Height * (n - primaryIndex); 2845curLoc.Y += grid.Height * (primaryIndex - n); 2854curLoc.Y += grid.Height * (n - primaryIndex); 2858curLoc.Y -= grid.Height * (primaryIndex - n); 2863curLoc.Y = lastLoc.Y + lastSize.Height + nEqualDelta; 3266if (max.Y < loc.Y + size.Height) 3268max.Y = loc.Y + size.Height; 3291Point parentOffset = new(parentSize.Width / 2, parentSize.Height / 2); 3380groupEndY = parentOffset.Y + gridSize.Height; 3383if (groupEndX > parentSize.Width || groupEndY > parentSize.Height)
System\Windows\Forms\Design\ComponentTray.cs (8)
1997rc.Height = _cyIcon + 2 * WhiteSpace + sz.Height + 4 * _borderWidth; 2002rc.Height = Math.Max(_cyIcon, sz.Height) + 4 * _borderWidth; 2192minDrag.Height = Math.Max(minDrag.Height, minDblClick.Height); 2197Math.Abs(_mouseDragLast.Y - newPt.Y) < minDrag.Height)) 2422if (Math.Abs(bounds.X - x) > parentGridSize.Width || Math.Abs(bounds.Y - y) > parentGridSize.Height) 2452_cyIcon = SystemInformation.IconSize.Height; 2458_cyIcon = sz.Height;
System\Windows\Forms\Design\ControlCommandSet.cs (2)
645if ((primaryControlsize.Width <= 0) || (primaryControlsize.Height <= 0)) 699moveOffsetY *= snapSize.Height;
System\Windows\Forms\Design\ControlDesigner.cs (7)
1381minDrag.Height = Math.Max(minDrag.Height, minDblClick.Height); 1386Math.Abs(_mouseDragLast.Y - y) < minDrag.Height)) 2251Rectangle imageRect = new(marginX, marginY, glyphSize.Width, glyphSize.Height); 2260Math.Max(SystemInformation.ToolWindowCaptionHeight - SystemInformation.BorderSize.Height - 2, Control.Font.Height), 2340&& y >= _lastClickMessagePositionY - dblClick.Height 2341&& y <= _lastClickMessagePositionY + dblClick.Height)
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
457ScaleHelper.ScaleToPercent(_initialSize.Height, scalePercent));
System\Windows\Forms\Design\DesignerFrame.cs (1)
166_designer!.Location = new Point(selectionSize.Width, selectionSize.Height);
System\Windows\Forms\Design\DesignerOptions.cs (2)
35if (value.Height < MinGridSize) 45if (value.Height > MaxGridSize)
System\Windows\Forms\Design\DesignerUtils.cs (7)
147s_minDragSize.Height = Math.Max(minDrag.Height, minDblClick.Height); 198g.DrawLine(pen, 1, imageSize.Height - 1, imageSize.Width - 2, imageSize.Height - 1); 199g.DrawLine(pen, 0, 1, 0, imageSize.Height - 2); 200g.DrawLine(pen, imageSize.Width - 1, 1, imageSize.Width - 1, imageSize.Height - 2); 205g.DrawRectangle(pen, i, i, imageSize.Width - (2 + i), imageSize.Height - (2 + i));
System\Windows\Forms\Design\FormDocumentDesigner.cs (2)
276float percY = newVar.Height / ((float)baseVar.Height); 428int clientHeight = form.ClientSize.Height;
System\Windows\Forms\Design\InheritanceUI.cs (1)
37s_inheritanceGlyphRect = new Rectangle(0, 0, size.Width, size.Height);
System\Windows\Forms\Design\ParentControlDesigner.cs (19)
253if (value.Width < MinGridSize || value.Height < MinGridSize || 254value.Width > MaxGridSize || value.Height > MaxGridSize) 424loc.Offset(GridSize.Width, GridSize.Height); 497bounds.Y = selectedControl.Location.Y + GridSize.Height; 507bounds.Height = size.Height; 534bounds.Y += offset.Height; 919int parentHeight = parent.ClientSize.Height; 969if (size.Width <= 0 || size.Height <= 0) 1139Point halfGrid = new(gridSize.Width / 2, gridSize.Height / 2); 1159updatedRect.Y = (dragRect.Y / gridSize.Height) * gridSize.Height; 1164updatedRect.Y += gridSize.Height; 1173updatedRect.Height = ((dragRect.Y + dragRect.Height) / gridSize.Height) * gridSize.Height - updatedRect.Y; 1179if (updatedRect.Height < gridSize.Height) 1180updatedRect.Height = gridSize.Height; 1861Size minControlSize = new(DesignerUtils.MinDragSize.Width * 2, DesignerUtils.MinDragSize.Height * 2); 1867if (offset.Height < minControlSize.Height) 1869offset.Height = minControlSize.Height;
System\Windows\Forms\Design\SelectionUIHandler.cs (6)
72containerRect.Inflate(snapSize.Width, snapSize.Height); 326if (targetHeight < minSize.Height) 328targetHeight = minSize.Height; 502if (heightProp is not null && !heightProp.IsReadOnly && size.Height != (int)heightProp.GetValue(components[i])!) 511controls[i].Height = size.Height; 650Height = sz.Height;
System\Windows\Forms\Design\SelectionUIService.cs (1)
632Math.Abs(screenCoord.Y - _mouseDragAnchor.Y) < minDragSize.Height)
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (1)
232Size = new Size(Size.Width + _resetButton.Size.Width - resetButtonSize.Width, Size.Height);
System\Windows\Forms\Design\TabOrder.cs (1)
258convertedRectangle.Height = sz.Height + 2;
System\Windows\Forms\Design\ToolStripEditorManager.cs (1)
142private void UpdateSize() => Size = new Size(_wrappedEditor.Size.Width, _wrappedEditor.Size.Height);
System\Windows\Forms\Design\ToolStripItemBehavior.cs (2)
991parentDesigner.DragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.X - (dragSize.Width / 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize); 1014ownerItemDesigner._dragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.X - (dragSize.Width / 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
1181if (_toolStripAdornerWindowService is not null && (dropDown.Width < _dropDownSizeToInvalidate.Width || dropDown.Size.Height < _dropDownSizeToInvalidate.Height))
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\InheritedPropertyDescriptorTests.cs (2)
18size.Height.Should().Be(0); 22size.Height.Should().Be(120);
System.Windows.Forms.Primitives (8)
System\Windows\Forms\Internals\ScaleHelper.cs (8)
164if (desiredSize.Width % originalSize.Width == 0 && desiredSize.Height % originalSize.Height == 0) 171else if (desiredSize.Width < originalSize.Width && desiredSize.Height < originalSize.Height) 177Bitmap scaledBitmap = new(desiredSize.Width, desiredSize.Height, bitmap.PixelFormat); 184RectangleF sourceBounds = new(0, 0, bitmap.Size.Width, bitmap.Size.Height); 185RectangleF destinationBounds = new(0, 0, desiredSize.Width, desiredSize.Height); 303: new(ScaleToDpi(logicalSize.Width, dpi), ScaleToDpi(logicalSize.Height, dpi));
System.Windows.Forms.Primitives.Tests (3)
Interop\Ole32\IPictureTests.cs (3)
27Assert.Equal(arrow.Size.Height, GdiHelper.HimetricToPixelY(height)); 44Assert.Equal(bitmap.Size.Height, GdiHelper.HimetricToPixelY(height)); 63Assert.Equal(bitmap.Size.Height, GdiHelper.HimetricToPixelY((int)variant.data.uintVal));
System.Windows.Forms.Tests (188)
DpiHelperTests.cs (1)
26(int)Math.Round(value.Height * (ScaleHelper.InitialSystemDpi / (double)ScaleHelper.OneHundredPercentLogicalDpi)));
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (2)
396comboBox.Size = new Size(100, comboBox.Size.Height); 458comboBox.Size = new Size(100, comboBox.Size.Height);
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (1)
155int expectedHeight = dataGridView.Size.Height;
System\Windows\Forms\ButtonTests.cs (8)
1341Assert.Equal(new Size(75, minSize.Height + 6 + 9), size); 1346Assert.Equal(new Size(75, minSize.Height + 6 + 9), size); 1637Assert.Equal(new Size(75, minSize.Height + 13 + 8), size); 1642Assert.Equal(new Size(75, minSize.Height + 13 + 8), size); 1685Assert.Equal(new Size(75, minSize.Height + 13 + 6), size); 1690Assert.Equal(new Size(75, minSize.Height + 13 + 6), size); 1733Assert.Equal(new Size(75, minSize.Height + 13 + 6), size); 1738Assert.Equal(new Size(75, minSize.Height + 13 + 6), size);
System\Windows\Forms\CheckBoxTests.cs (1)
98Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\ComboBox.ComboBoxChildListUiaProviderTests.cs (1)
111comboBox.Size = new Size(expectedWidth, comboBox.Size.Height);
System\Windows\Forms\ControlTests.Methods.cs (19)
9781control.SetClientSizeCore(value.Width, value.Height); 9791control.SetClientSizeCore(value.Width, value.Height); 9815control.SetClientSizeCore(value.Width, value.Height); 9823Assert.Equal(expectedSize.Height, control.Bottom); 9825Assert.Equal(expectedSize.Height, control.Height); 9831control.SetClientSizeCore(value.Width, value.Height); 9839Assert.Equal(expectedSize.Height, control.Bottom); 9841Assert.Equal(expectedSize.Height, control.Height); 9863control.SetClientSizeCore(value.Width, value.Height); 9871Assert.Equal(expectedSize.Height, control.Bottom); 9873Assert.Equal(expectedSize.Height, control.Height); 9882control.SetClientSizeCore(value.Width, value.Height); 9890Assert.Equal(expectedSize.Height, control.Bottom); 9892Assert.Equal(expectedSize.Height, control.Height); 10119Size expected = new(clientSize.Width + 4, clientSize.Height + 4); 10399Assert.True(control.ClientSize.Height >= 0); 10409Assert.True(control.Size.Height > 0); 10432Assert.True(control.ClientSize.Height >= 0); 10442Assert.True(control.Size.Height >= 0);
System\Windows\Forms\ControlTests.Properties.cs (34)
3388Assert.Equal(expectedSize.Height, control.Bottom); 3390Assert.Equal(expectedSize.Height, control.Height); 3404Assert.Equal(expectedSize.Height, control.Bottom); 3406Assert.Equal(expectedSize.Height, control.Height); 3451Assert.Equal(expectedSize.Height, control.Bottom); 3453Assert.Equal(expectedSize.Height, control.Height); 3470Assert.Equal(expectedSize.Height, control.Bottom); 3472Assert.Equal(expectedSize.Height, control.Height); 11113Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.ClientRectangle); 11114Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.DisplayRectangle); 11119Assert.Equal(value.Height, control.Bottom); 11121Assert.Equal(value.Height, control.Height); 11122Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds); 11132Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.ClientRectangle); 11133Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.DisplayRectangle); 11138Assert.Equal(value.Height, control.Bottom); 11140Assert.Equal(value.Height, control.Height); 11141Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds); 11325Assert.Equal(value.Height, control.Bottom); 11327Assert.Equal(value.Height, control.Height); 11328Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds); 11344Assert.Equal(value.Height, control.Bottom); 11346Assert.Equal(value.Height, control.Height); 11347Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds); 11434Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.ClientRectangle); 11435Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.DisplayRectangle); 11440Assert.Equal(value.Height, control.Bottom); 11442Assert.Equal(value.Height, control.Height); 11443Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds); 11454Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.ClientRectangle); 11455Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.DisplayRectangle); 11460Assert.Equal(value.Height, control.Bottom); 11462Assert.Equal(value.Height, control.Height); 11463Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds);
System\Windows\Forms\CursorsTests.cs (1)
55Assert.True(hotSpot.Y >= 0 && hotSpot.Y <= cursor.Size.Height);
System\Windows\Forms\CursorTests.cs (4)
233Assert.True(hotSpot.Y >= 0 && hotSpot.Y <= cursor.Size.Height); 368yield return new object[] { new Rectangle(0, 0, Cursors.Default.Size.Width, Cursors.Default.Size.Height) }; 369yield return new object[] { new Rectangle(1, 0, Cursors.Default.Size.Width, Cursors.Default.Size.Height) }; 370yield return new object[] { new Rectangle(0, 2, 3, Cursors.Default.Size.Height) };
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (2)
14private static readonly int s_preferredHeight = Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3; 99Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\Design\ComponentEditorFormTests.cs (5)
32Assert.True(control.AutoScaleBaseSize.Height > 0); 56Assert.Equal(new Rectangle(0, 0, control.ClientSize.Width, control.ClientSize.Height), control.ClientRectangle); 57Assert.Equal(new Size(control.ClientSize.Width, control.ClientSize.Height), control.ClientSize); 79Assert.Equal(new Rectangle(0, 0, control.ClientSize.Width, control.ClientSize.Height), control.DisplayRectangle); 131Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\FormTests.cs (4)
30Assert.True(control.AutoScaleBaseSize.Height > 0); 54Assert.Equal(new Rectangle(0, 0, control.ClientSize.Width, control.ClientSize.Height), control.ClientRectangle); 56Assert.True(control.ClientSize.Height > 0); 133Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\HScrollBarTests.cs (4)
44Assert.True(control.ClientSize.Height > 0); 59Assert.True(control.DefaultSize.Height > 0); 93Assert.True(control.PreferredSize.Height > 0); 105Assert.True(control.Size.Height > 0);
System\Windows\Forms\LabelTests.cs (1)
89Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\ListBoxTests.cs (5)
100Assert.Equal(Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3, control.PreferredHeight); 2050int extra = SystemInformation.BorderSize.Height * 4 + 3; 2079int extra = SystemInformation.BorderSize.Height * 4 + 3; 4849Assert.Equal(control.PreferredHeight, result.Height); 4882Assert.Equal(control.PreferredHeight + 6, result.Height);
System\Windows\Forms\MdiClientTests.cs (6)
544Assert.Equal(value.Height, control.Bottom); 546Assert.Equal(value.Height, control.Height); 547Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds); 563Assert.Equal(value.Height, control.Bottom); 565Assert.Equal(value.Height, control.Height); 566Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds);
System\Windows\Forms\MenuStripTests.cs (1)
119Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\MonthCalendarTests.cs (9)
49Assert.True(control.ClientSize.Height > 0); 68Assert.True(control.DefaultSize.Height > 0); 105Assert.True(control.PreferredSize.Height > 0); 127Assert.True(control.Size.Height > 0); 648Assert.True(calendar.CalendarDimensions.Height is > 0 and <= 12); 655Assert.True(calendar.CalendarDimensions.Height is > 0 and <= 12); 706Assert.True(calendar.CalendarDimensions.Height is > 0 and <= 12); 716Assert.True(calendar.CalendarDimensions.Height is > 0 and <= 12); 2434Assert.True(size.Height >= 153);
System\Windows\Forms\RichTextBoxTests.cs (3)
22private static readonly int s_preferredHeight = Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3; 106Assert.True(control.PreferredSize.Height > 0); 107Assert.Equal(control.PreferredSize.Height, control.PreferredHeight);
System\Windows\Forms\SplitterPanelTests.cs (10)
829Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.ClientRectangle); 830Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.DisplayRectangle); 835Assert.Equal(value.Height, control.Bottom); 837Assert.Equal(value.Height, control.Height); 838Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds); 848Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.ClientRectangle); 849Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.DisplayRectangle); 854Assert.Equal(value.Height, control.Bottom); 856Assert.Equal(value.Height, control.Height); 857Assert.Equal(new Rectangle(0, 0, value.Width, value.Height), control.Bounds);
System\Windows\Forms\StatusStripTests.cs (1)
118Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\SystemInformationTests.cs (24)
50Assert.True(size.Height >= 0); 67Assert.True(size.Height >= 0); 76Assert.True(size.Height >= 0); 138Assert.True(size.Height >= 0); 161Assert.True(size.Height >= 0); 170Assert.True(size.Height >= 0); 195Assert.True(size.Height >= 0); 259Assert.True(size.Height >= 32); 268Assert.True(size.Height >= 0); 405Assert.True(size.Height >= 0); 420Assert.True(size.Height >= 0); 429Assert.True(size.Height >= 0); 438Assert.True(size.Height >= 0); 477Assert.True(size.Height >= 0); 486Assert.True(size.Height >= 0); 495Assert.True(size.Height > 0); 504Assert.True(size.Height > 0); 542Assert.True(size.Height >= 0); 629Assert.True(size.Height > 0); 638Assert.True(size.Height > 0); 681Assert.True(size.Height > 0); 690Assert.True(size.Height > 0); 705Assert.True(size.Height > 0); 822Assert.True(size.Height >= 0);
System\Windows\Forms\TabControlTests.cs (3)
1447Assert.True(size.Height > 0); 1463Assert.True(size.Height > 0); 1546Assert.True(size.Height > 0);
System\Windows\Forms\TextRendererTests.cs (6)
406Assert.True(result.Height > 0); 430Assert.True(result.Height > 0); 462Assert.True(result.Height > 0); 477Assert.True(result.Height > 0); 492Assert.True(result.Height > 0); 507Assert.True(result.Height > 0);
System\Windows\Forms\ToolStripComboBoxTests.cs (3)
389preferredSize.Height.Should().BeGreaterThan(0); 400preferredSize.Height.Should().Be(basePreferredSize.Height);
System\Windows\Forms\ToolStripControlHostTests.cs (2)
2214Assert.Equal(new Rectangle(1, 2, value.Width, value.Height), c.Bounds); 2220Assert.Equal(new Rectangle(1, 2, value.Width, value.Height), c.Bounds);
System\Windows\Forms\ToolStripDropDownTests.cs (2)
127Assert.True(control.PreferredSize.Height > 0); 5006expectedLocation.Offset(nonClientSize.Width - 3, nonClientSize.Height - 1);
System\Windows\Forms\ToolStripTests.cs (2)
135Assert.True(control.PreferredSize.Height > 0); 290Assert.True(control.PreferredSize.Height > 0);
System\Windows\Forms\TreeViewTests.cs (1)
40Assert.Equal(93, control.ClientSize.Height);
System\Windows\Forms\UpDownBaseTests.cs (12)
719yield return new object[] { BorderStyle.Fixed3D, new Size(122, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 720yield return new object[] { BorderStyle.FixedSingle, new Size(122, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 725yield return new object[] { BorderStyle.Fixed3D, new Size(123, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 726yield return new object[] { BorderStyle.FixedSingle, new Size(121, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 740Assert.Equal(expectedPreferredSize.Height, control.PreferredHeight); 747Assert.Equal(expectedPreferredSize.Height, control.PreferredHeight); 756yield return new object[] { BorderStyle.Fixed3D, 0, 0, new Size(122, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 757yield return new object[] { BorderStyle.FixedSingle, 0, 1, new Size(122, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 762yield return new object[] { BorderStyle.Fixed3D, 0, 0, new Size(123, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 763yield return new object[] { BorderStyle.FixedSingle, 1, 1, new Size(123, Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3) }; 783Assert.Equal(expectedPreferredSize.Height, control.PreferredHeight); 793Assert.Equal(expectedPreferredSize.Height, control.PreferredHeight);
System\Windows\Forms\VScrollBarTests.cs (4)
43Assert.True(control.ClientSize.Height > 0); 58Assert.True(control.DefaultSize.Height > 0); 92Assert.True(control.PreferredSize.Height > 0); 104Assert.True(control.Size.Height > 0);
Text\FontMetrics.cs (1)
69Assert.Equal(height, extent.Height);
TextBoxBaseTests.cs (3)
16private static readonly int s_preferredHeight = Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3; 5109Assert.True(result.Height >= expectedMinimumHeight); 5115Assert.True(result.Height >= expectedMinimumHeight);
TextBoxTests.cs (2)
13private static readonly int s_preferredHeight = Control.DefaultFont.Height + SystemInformation.BorderSize.Height * 4 + 3; 93Assert.True(control.PreferredSize.Height > 0);
System.Windows.Forms.UI.IntegrationTests (14)
ButtonTests.cs (7)
131Assert.Equal(originalFormSize.Height, form.DisplayRectangle.Height); 154Assert.True(form.DisplayRectangle.Height > originalFormSize.Height); 181Assert.Equal(originalFormSize.Height, form.DisplayRectangle.Height); 210Assert.True(form.DisplayRectangle.Height > originalFormSize.Height); 216Assert.Equal(originalFormSize.Height - originalButtonPosition.Bottom, form.DisplayRectangle.Height - button.DisplayRectangle.Bottom); 262int verticalResolution = primaryMonitor.Height; 298int verticalResolution = primaryMonitor.Height;
DragDropTests.cs (1)
722e.Y - (dragSize.Height / 2)),
Infra\ControlTestBase.cs (2)
186(int)Math.Ceiling((65535.0 / (primaryMonitor.Height - 1)) * point.Y)); 194TestOutputHelper.WriteLine($"Screen resolution of ({primaryMonitor.Width}, {primaryMonitor.Height}) translates mouse to ({virtualPoint.X}, {virtualPoint.Y}).");
Infra\ScreenRecordService.cs (2)
483WritePngUInt32(stream, buffer, crc, checked((uint)size.Height)); 487WritePngUInt32(stream, buffer, crc, checked((uint)offset.Height));
MDITests.cs (2)
29int childFormMinimizedYPositionFromBottom = form.ClientSize.Height - childForm.Top; 32Assert.Equal(childFormMinimizedYPositionFromBottom, form.ClientSize.Height - childForm.Top);
WindowsFormsIntegration (12)
System\Windows\Integration\Convert.cs (2)
236Size returnSize = new Size((double)size.Width, (double)size.Height); 247Size returnSize = new Size((double)size.Width, (double)size.Height);
System\Windows\Integration\ElementHost.cs (2)
318int maxHeight = Math.Min(priorMaxSize.Height, maxElementSize.Height);
System\Windows\Integration\HostUtils.cs (8)
45if (size.Height == 0) { size.Height = int.MaxValue; } 53if (size.Height == 0 || size.Height == 1) { size.Height = int.MaxValue; } 63if (size.Height == int.MaxValue) 74Math.Max(size1.Height, size2.Height)); 81Math.Min(size1.Height, size2.Height));
WinFormsControlsTest (2)
ComboBoxesWithScrollBars.cs (1)
27changeCBHeight_UpDown2.Value = comboBox2.Size.Height;
MainForm.cs (1)
295(int)Math.Ceiling((overarchingFlowLayoutPanel.Controls.Count + 1) / 3.0) * (biggestButton.Height + padding * 2)