System\Windows\Forms\Controls\ComboBox\ComboBox.cs (5)
381return new Size(121, PreferredHeight);
663set => base.MaximumSize = new Size(value.Width, 0);
669set => base.MinimumSize = new Size(value.Width, 0);
774Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
785Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (14)
1287ScaleHelper.GetIconResourceAsBitmap(typeof(DataGridViewCell), bitmapName, new Size(s_iconsWidth, s_iconsHeight));
2290return GetPreferredSize(screen, dataGridViewCellStyle, rowIndex, new Size(width, 0)).Height;
2297return new Size(-1, -1);
2309Size constraintSize) => new(-1, -1);
2345return GetPreferredSize(screen, dataGridViewCellStyle, rowIndex, new Size(0, height)).Width;
2352return new Size(-1, -1);
2362return new Size(OwningColumn.Thickness, OwningRow.GetHeight(rowIndex));
2552Size requiredSize = TextRenderer.MeasureText(text, font, new Size(maxWidth, int.MaxValue), flags);
2576return new Size(0, 0);
2591textSize = TextRenderer.MeasureText(text, font, new Size((int)maxWidth, int.MaxValue), flags);
2620return TextRenderer.MeasureText(text, font, new Size(int.MaxValue, int.MaxValue), flags);
2647textSize = TextRenderer.MeasureText(text, font, new Size((int)maxWidth, maxHeight), flags);
3772DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
3858DataGridView.EditingPanel.Size = new Size(wEditingPanel, hEditingPanel);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (10)
403return new Size(-1, -1);
435preferredSize = new Size(0, Math.Min(img.Height, decimal.ToInt32((decimal)img.Height * imgWidthAllowed / img.Width)));
447preferredSize = new Size(0, Math.Min(ico.Height, decimal.ToInt32((decimal)ico.Height * icoWidthAllowed / ico.Width)));
453preferredSize = new Size(0, 1);
470preferredSize = new Size(Math.Min(img.Width, decimal.ToInt32((decimal)img.Width * imgHeightAllowed / img.Height)), 0);
482preferredSize = new Size(Math.Min(ico.Width, decimal.ToInt32((decimal)ico.Width * icoHeightAllowed / ico.Height)), 0);
488preferredSize = new Size(1, 0);
495preferredSize = new Size(img.Width, img.Height);
499preferredSize = new Size(ico.Width, ico.Height);
503preferredSize = new Size(1, 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (11)
130Size = new(208, 43),
138Size = new(64, 64),
151Size = new(100, 23),
163Size = new(75, 23),
176Size = new(75, 23),
190Size = new(290, 29),
213Size = new(284, 73),
230Size = new(290, 108),
231MinimumSize = new(279, 50),
255Size = new(273, 100),
269ClientSize = new(299, 113);
System\Windows\Forms\Form.cs (6)
449return new Size((int)Math.Round(real.Width), (int)Math.Round(real.Height));
886protected override Size DefaultSize => new Size(300, 300);
1243Size = new Size(Math.Min(size.Width, value.Width), Math.Min(size.Height, value.Height));
1360Size = new Size(Math.Max(size.Width, value.Width), Math.Max(size.Height, value.Height));
2984Size newVar = new((int)Math.Round(newVarF.Width), (int)Math.Round(newVarF.Height));
4480_dpiFormSizes.Add(e.DeviceDpiNew, new Size(e.SuggestedRectangle.Width, e.SuggestedRectangle.Height));
System\Windows\Forms\Layout\CommonProperties.cs (6)
32internal static Size DefaultMinimumSize { get; } = new(0, 0);
33internal static Size DefaultMaximumSize { get; } = new(0, 0);
200Debug.Assert(value != GetMaximumSize(element, new Size(-7109, -7107)),
214Debug.Assert(GetMaximumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MaximumSize.");
222Debug.Assert(value != GetMinimumSize(element, new Size(-7109, -7107)),
236Debug.Assert(GetMinimumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MinimumSize.");
System\Windows\Forms\Layout\Containers\SplitContainer.cs (15)
328return new Size(150, 100);
1601Panel1.Size = new Size(0, Panel1.Height);
1602Panel2.Size = new Size(0, Panel2.Height);
1607Panel1.Size = new Size(Panel1.Width, 0);
1608Panel2.Size = new Size(Panel2.Width, 0);
1619Panel1.Size = new Size(_panelSize, Height);
1620Panel2.Size = new Size(Math.Max(Width - _panelSize - SplitterWidthInternal, Panel2MinSize), Height);
1625Panel2.Size = new Size(_panelSize, Height);
1640Panel2.Size = new Size(Math.Max(Width - _splitterDistance - SplitterWidthInternal, Panel2MinSize), Height);
1677Panel1.Size = new Size(Width, _panelSize);
1679Panel2.Size = new Size(Width, Math.Max(Height - panel2Start, Panel2MinSize));
1685Panel2.Size = new Size(Width, _panelSize);
1704Panel2.Size = new Size(Width, Math.Max(Height - panel2Start, Panel2MinSize));
2178Panel2.Size = new Size(Width - _splitterDistance - SplitterWidthInternal, Height);
2228Panel2.Size = new Size(Width, Height - panel2Start);
System\Windows\Forms\Layout\TableLayout.cs (7)
105Size containerSize = container.DisplayRectangle.Size - new Size(cellBorderWidth, cellBorderWidth);
119CommonProperties.SetLayoutBounds(containerInfo.Container, new Size(SumStrips(containerInfo.Columns, 0, containerInfo.Columns.Length),
162Size containerSize = container.DisplayRectangle.Size - new Size(cellBorderWidth * 2, cellBorderWidth * 2);
176Size cellBorderSize = new(cellBorderWidth, cellBorderWidth);
726minWidth = GetElementSize(element, new Size(0, constrainingHeight)).Width;
731minWidth = GetElementSize(element, new Size(1, 0)).Width;
856int minHeight = GetElementSize(element, new Size(currentWidth - margin.Horizontal, 0)).Height + margin.Vertical;
System\Windows\Forms\Printing\PrintPreviewControl.cs (7)
34private Size _virtualSize = new(1, 1);
60Size = new Size(100, 100);
491_imageSize = new Size((int)(_zoom * pageSize.Width), (int)(_zoom * pageSize.Height));
494SetVirtualSizeNoInvalidate(PhysicalToPixels(new Size(virtualX, virtualY), _screenDPI));
661_imageSize = new Size((int)(_zoom * pageSize.Width), (int)(_zoom * pageSize.Height));
752new(PixelsToPhysical(pixels.Width, dpi.X), PixelsToPhysical(pixels.Height, dpi.Y));
758new(PhysicalToPixels(physical.Width, dpi.X), PhysicalToPixels(physical.Height, dpi.Y));