661 instantiations of Size
Microsoft.Extensions.AI.Abstractions.Tests (9)
Image\ImageGenerationOptionsTests.cs (8)
42options.ImageSize = new Size(1024, 768); 49Assert.Equal(new Size(1024, 768), options.ImageSize); 57Assert.Equal(new Size(1024, 768), clone.ImageSize); 70ImageSize = new Size(256, 256), 82Assert.Equal(new Size(256, 256), deserialized.ImageSize); 94ImageSize = new Size(512, 512), 104original.ImageSize = new Size(1024, 1024); 111Assert.Equal(new Size(512, 512), clone.ImageSize);
Image\ImageGeneratorTests.cs (1)
108ImageSize = new Size(1024, 768),
Microsoft.Extensions.AI.Integration.Tests (2)
ImageGeneratingChatClientIntegrationTests.cs (2)
332ImageSize = new System.Drawing.Size(512, 512) 350Assert.Equal(new System.Drawing.Size(512, 512), options.ImageSize);
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIConversionTests.cs (1)
332ImageSize = new System.Drawing.Size(1024, 1024),
OpenAIResponseClientTests.cs (3)
5729ImageSize = new(1024, 1024), 5830ImageSize = new(1024, 1024), 5947ImageSize = new(512, 512),
Microsoft.Extensions.AI.Tests (1)
Image\OpenTelemetryImageGeneratorTests.cs (1)
80ImageSize = new(1024, 768),
Microsoft.Private.Windows.Core (3)
_generated\206\Windows.Win32.RECT.g.cs (1)
72 internal readonly global::System.Drawing.Size Size => new global::System.Drawing.Size(this.Width, this.Height);
_generated\217\Windows.Win32.SIZE.g.cs (1)
51 public static implicit operator global::System.Drawing.Size(SIZE value) => new global::System.Drawing.Size(value.cx, value.cy);
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
101value = new Size(classInfo.GetInt32("width"), classInfo.GetInt32("height"));
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\MyServices\Internal\ProgressDialog.vb (2)
133LabelInfo.MaximumSize = New Size(300, 0) 206LabelInfo.MaximumSize = New Size(ClientSize.Width - BORDER_SIZE, 0)
PresentationUI (164)
MS\Internal\Documents\Application\DocumentPropertiesDialog.Designer.cs (51)
133this.tableLayoutPanel3.Size = new System.Drawing.Size(362, 437); 143this._tabControl.Size = new System.Drawing.Size(436, 535); 155this._summaryTab.Size = new System.Drawing.Size(324, 355); 205this.tableLayoutPanel1.Size = new System.Drawing.Size(324, 297); 213this._language.Size = new System.Drawing.Size(335, 13); 223this._title.Size = new System.Drawing.Size(335, 13); 232this._titleLabel.Size = new System.Drawing.Size(27, 13); 240this._identifier.Size = new System.Drawing.Size(335, 13); 249this._versionLabel.Size = new System.Drawing.Size(42, 13); 257this._authorLabel.Size = new System.Drawing.Size(38, 13); 265this._statusLabel.Size = new System.Drawing.Size(37, 13); 273this._contentLabel.Size = new System.Drawing.Size(44, 13); 281this._languageLabel.Size = new System.Drawing.Size(55, 13); 289this._subjectLabel.Size = new System.Drawing.Size(43, 13); 297this._version.Size = new System.Drawing.Size(335, 13); 306this._categoryLabel.Size = new System.Drawing.Size(49, 13); 314this._category.Size = new System.Drawing.Size(335, 13); 323this._status.Size = new System.Drawing.Size(335, 13); 332this._content.Size = new System.Drawing.Size(335, 13); 341this._keywordsLabel.Size = new System.Drawing.Size(53, 13); 350this._author.Size = new System.Drawing.Size(335, 13); 359this._subject.Size = new System.Drawing.Size(335, 13); 369this._description.Size = new System.Drawing.Size(335, 101); 380this._keywords.Size = new System.Drawing.Size(335, 28); 391this._identifierLabel.Size = new System.Drawing.Size(47, 13); 400this._descriptionLabel.Size = new System.Drawing.Size(60, 13); 426this._infoTab.Size = new System.Drawing.Size(348, 379); 445this.tableLayoutPanel2.Size = new System.Drawing.Size(314, 355); 477this._size.Size = new System.Drawing.Size(270, 28); 485this._iconPictureBox.Size = new System.Drawing.Size(40, 40); 495this._filename.Size = new System.Drawing.Size(340, 13); 505this._documentType.Size = new System.Drawing.Size(340, 13); 515this._sizeLabel.Size = new System.Drawing.Size(40, 13); 526this._documentDetailBox.Size = new System.Drawing.Size(305, 127); 563this._documentPrintedDate.Size = new System.Drawing.Size(282, 13); 572this._documentModifiedDate.Size = new System.Drawing.Size(282, 13); 581this._documentCreatedDate.Size = new System.Drawing.Size(282, 13); 590this._revision.Size = new System.Drawing.Size(282, 13); 599this._documentPrintedLabel.Size = new System.Drawing.Size(43, 13); 607this._documentModifiedLabel.Size = new System.Drawing.Size(50, 13); 615this._documentCreatedLabel.Size = new System.Drawing.Size(47, 13); 623this._revisionLabel.Size = new System.Drawing.Size(51, 13); 631this._lastSavedLabel.Size = new System.Drawing.Size(79, 13); 639this._lastSaved.Size = new System.Drawing.Size(282, 13); 679this._fileModifiedDate.Size = new System.Drawing.Size(282, 13); 688this._fileAccessedDate.Size = new System.Drawing.Size(282, 13); 697this._fileCreatedLabel.Size = new System.Drawing.Size(47, 13); 705this._fileModifiedLabel.Size = new System.Drawing.Size(50, 13); 713this._fileCreatedDate.Size = new System.Drawing.Size(282, 13); 722this._fileAccessedLabel.Size = new System.Drawing.Size(57, 13); 730this.ClientSize = new System.Drawing.Size(466, 574);
MS\Internal\Documents\CredentialManagerDialog.Designer.cs (5)
69this._mainDialogTableLayoutPanel.Size = new System.Drawing.Size(398, 157); 144this._credListBox.Size = new System.Drawing.Size(299, 82); 152this._instructionLabel.MaximumSize = new System.Drawing.Size(400, 0); 154this._instructionLabel.Size = new System.Drawing.Size(0, 0); 165this.ClientSize = new System.Drawing.Size(409, 168);
MS\Internal\Documents\RequestedSignatureDialog.Designer.cs (14)
65_buttomControlLayoutpanel.Size = new System.Drawing.Size(56, 24); 73_addButton.Size = new System.Drawing.Size(65, 6); 83_cancelButton.Size = new System.Drawing.Size(65, 6); 118_userInputTableLayoutPanel.Size = new System.Drawing.Size(407, 197); 125_dateTimePicker.Size = new System.Drawing.Size(245, 20); 137_requestedLocationTextBox.Size = new System.Drawing.Size(401, 20); 147_signatureAppliedByDateLabel.Size = new System.Drawing.Size(17, 13); 156_requestSignerNameLabel.Size = new System.Drawing.Size(17, 13); 165_requestLocationLabel.Size = new System.Drawing.Size(17, 13); 173_requestedSignerNameTextBox.Size = new System.Drawing.Size(401, 20); 183_intentLabel.Size = new System.Drawing.Size(17, 13); 192_intentComboBox.Size = new System.Drawing.Size(401, 21); 211_mainDialogTableLayoutPanel.Size = new System.Drawing.Size(433, 273); 220ClientSize = new System.Drawing.Size(451, 282);
MS\Internal\Documents\RMEnrollmentPage1.Designer.cs (16)
69_panel1.Size = new System.Drawing.Size(398, 196); 80_flowLayoutPanel2.Size = new System.Drawing.Size(398, 153); 90_flowLayoutPanel3.Size = new System.Drawing.Size(353, 111); 104_flowLayoutPanel4.Size = new System.Drawing.Size(198, 89); 112_label1.MaximumSize = new System.Drawing.Size(400, 0); 114_label1.Size = new System.Drawing.Size(392, 13); 122_label2.MaximumSize = new System.Drawing.Size(400, 0); 124_label2.Size = new System.Drawing.Size(0, 0); 132_label3.MaximumSize = new System.Drawing.Size(400, 0); 134_label3.Size = new System.Drawing.Size(165, 13); 142_privacyLabel.MaximumSize = new System.Drawing.Size(400, 0); 144_privacyLabel.Size = new System.Drawing.Size(89, 13); 154_instructionlabel.Size = new System.Drawing.Size(140, 13); 162_panel2.Size = new System.Drawing.Size(13, 105); 170_pictureBox.Size = new System.Drawing.Size(78, 75); 208ClientSize = new System.Drawing.Size(398, 196);
MS\Internal\Documents\RMEnrollmentPage2.Designer.cs (14)
69this._flowLayoutPanel1.Size = new System.Drawing.Size(548, 43); 101this._flowLayoutPanel2.Size = new System.Drawing.Size(548, 326); 110this._label1.Size = new System.Drawing.Size(322, 13); 122this._flowLayoutPanel3.Size = new System.Drawing.Size(528, 38); 131this._pictureBox1.Size = new System.Drawing.Size(16, 16); 140this._label2.MaximumSize = new System.Drawing.Size(490, 0); 142this._label2.Size = new System.Drawing.Size(490, 26); 157this._tableLayoutPanel1.MinimumSize = new System.Drawing.Size(488, 0); 164this._tableLayoutPanel1.Size = new System.Drawing.Size(488, 234); 173this._networkRadioButton.Size = new System.Drawing.Size(126, 17); 184this._pictureBox2.Size = new System.Drawing.Size(100, 50); 193this._passportRadioButton.Size = new System.Drawing.Size(132, 17); 203this._pictureBox4.Size = new System.Drawing.Size(100, 50); 213this.ClientSize = new System.Drawing.Size(548, 369);
MS\Internal\Documents\RMEnrollmentPage3.Designer.cs (7)
60this.tableLayoutPanel1.Size = new System.Drawing.Size(419, 218); 70this.flowLayoutPanel2.Size = new System.Drawing.Size(413, 27); 79this.label2.Size = new System.Drawing.Size(245, 13); 95this.tableLayoutPanel2.Size = new System.Drawing.Size(413, 135); 105this.label3.Size = new System.Drawing.Size(115, 13); 114this.progressBar1.Size = new System.Drawing.Size(100, 14); 123this.ClientSize = new System.Drawing.Size(419, 218);
MS\Internal\Documents\RMPermissions.Designer.cs (1)
187this.ClientSize = new System.Drawing.Size(196, 155);
MS\Internal\Documents\RMPublishingDialog.cs (2)
506new System.Drawing.Size(totalPadding, totalPadding)); 913System.Drawing.Size imageButtonSize = new System.Drawing.Size(
MS\Internal\Documents\RMPublishingDialog.Designer.cs (14)
93this.radioButtonUnrestricted.Size = new System.Drawing.Size(85, 17); 102this.radioButtonPermissions.Size = new System.Drawing.Size(85, 17); 111this.radioButtonTemplate.Size = new System.Drawing.Size(85, 17); 124this.groupBoxMainContent.Size = new System.Drawing.Size(650, 270); 165this.textBoxUnrestrictedText.Size = new System.Drawing.Size(625, 230); 181this.comboBoxTemplates.Size = new System.Drawing.Size(350, 21); 205this.textBoxUserName.MinimumSize = new System.Drawing.Size(326, 20); 242this.rightsTable.Size = new System.Drawing.Size(635, 150); 268this.textBoxPermissionsContact.Size = new System.Drawing.Size(612, 20); 307this.flowLayoutPanelActions.Size = new System.Drawing.Size(541, 29); 316this.buttonCancel.Size = new System.Drawing.Size(75, 23); 323this.buttonSave.Size = new System.Drawing.Size(75, 23); 330this.buttonSaveAs.Size = new System.Drawing.Size(75, 23); 374this.ClientSize = new System.Drawing.Size(554, 431);
MS\Internal\Documents\SignatureSummaryDialog.cs (12)
237MinimumSize = new Size(IconWidth + SummaryNameTextWidth, 0), 238MaximumSize = new Size(IconWidth + SummaryNameTextWidth, 0), 248MinimumSize = new Size(IntentTextWidth, 0), 249MaximumSize = new Size(IntentTextWidth, 0), 259MinimumSize = new Size(LocaleTextWidth, 0), 260MaximumSize = new Size(LocaleTextWidth, 0), 270MinimumSize = new Size(SignByTextWidth, 0), 271MaximumSize = new Size(SignByTextWidth, 0), 289MaximumSize = new Size(IconWidth + SummaryNameTextWidth, 0), 290MinimumSize = new Size(IconWidth + SummaryNameTextWidth, 0), 300MinimumSize = new Size(IntentTextWidth, 0), 301MaximumSize = new Size(IntentTextWidth, 0),
MS\Internal\Documents\SignatureSummaryDialog.Designer.cs (12)
59_buttonDone.Size = new System.Drawing.Size(75, 23); 82_flowpanelMiddleControls.Size = new System.Drawing.Size(335, 49); 95_flowpanelBottomControls.Size = new System.Drawing.Size(335, 49); 102_buttonSign.Size = new System.Drawing.Size(75, 23); 112_buttonViewCert.Size = new System.Drawing.Size(75, 23); 122_buttonRequestDelete.Size = new System.Drawing.Size(75, 23); 130_buttonRequestAdd.Size = new System.Drawing.Size(75, 23); 143_columnHeaderPanel.Size = new System.Drawing.Size(600, 25); 154_listBoxSummary.Size = new System.Drawing.Size(600, 217); 170_listboxMainPanel.Size = new System.Drawing.Size(602, 272); 179_listboxItemPanel.Size = new System.Drawing.Size(600, 217); 210MinimumSize = new System.Drawing.Size(629, 378);
MS\Internal\Documents\SigningDialog.Designer.cs (16)
66_userInputFlowPanel.Size = new System.Drawing.Size(475, 195); 95_signatureControlInputLayoutTable.Size = new System.Drawing.Size(466, 173); 103_addDigSigCheckBox.Size = new System.Drawing.Size(15, 14); 113_signerlabel.Size = new System.Drawing.Size(0, 0); 123_addDocPropCheckBox.Size = new System.Drawing.Size(15, 14); 132_reasonLabel.Size = new System.Drawing.Size(0, 0); 141_reasonComboBox.Size = new System.Drawing.Size(460, 21); 151_actionlabel.Size = new System.Drawing.Size(0, 0); 160_locationLabel.Size = new System.Drawing.Size(0, 0); 168_locationTextBox.Size = new System.Drawing.Size(460, 20); 190_buttonflowLayoutPanel.Size = new System.Drawing.Size(475, 17); 203_cancelButton.Size = new System.Drawing.Size(36, 6); 217_signButton.Size = new System.Drawing.Size(36, 6); 231_signSaveAsButton.Size = new System.Drawing.Size(36, 6); 249_mainLayoutTable.Size = new System.Drawing.Size(481, 292); 259ClientSize = new System.Drawing.Size(492, 303);
System.ComponentModel.TypeConverter (2)
System\Drawing\SizeConverter.cs (2)
50return new Size(width, height); 100return new Size((int)width, (int)height);
System.Drawing.Common (9)
misc\DpiHelper.cs (1)
176new Size(LogicalToDeviceUnitsX(logicalSize.Width), ScaleToInitialSystemDpi(logicalSize.Height));
System\Drawing\BufferedGraphicsContext.cs (2)
323_bufferSize = new Size(optWidth, optHeight); 332_virtualSize = new Size(width, height);
System\Drawing\Icon.cs (2)
212_iconSize = new Size(bitmap.bmWidth, bitmap.bmHeight); 221_iconSize = new Size(bitmap.bmWidth, bitmap.bmHeight / 2);
System\Drawing\Image.cs (1)
421public Size Size => new(Width, Height);
System\Drawing\Printing\PrinterUnitConvert.cs (1)
41new(Convert(value.Width, fromUnit, toUnit), Convert(value.Height, fromUnit, toUnit));
System\Drawing\ToolboxBitmapAttribute.cs (2)
19private static readonly Size s_largeSize = new(32, 32); 20private static readonly Size s_smallSize = new(16, 16);
System.Drawing.Primitives (9)
System\Drawing\Point.cs (1)
84public static explicit operator Size(Point p) => new Size(p.X, p.Y);
System\Drawing\Rectangle.cs (1)
74readonly get => new Size(Width, Height);
System\Drawing\Size.cs (7)
81public static Size operator /(Size left, int right) => new Size(unchecked(left.width / right), unchecked(left.height / right)); 151new Size(unchecked(sz1.Width + sz2.Width), unchecked(sz1.Height + sz2.Height)); 157new Size(unchecked((int)Math.Ceiling(value.Width)), unchecked((int)Math.Ceiling(value.Height))); 163new Size(unchecked(sz1.Width - sz2.Width), unchecked(sz1.Height - sz2.Height)); 168public static Size Truncate(SizeF value) => new Size(unchecked((int)value.Width), unchecked((int)value.Height)); 174new Size(unchecked((int)Math.Round(value.Width)), unchecked((int)Math.Round(value.Height))); 201new Size(unchecked(size.width * multiplier), unchecked(size.height * multiplier));
System.Private.Windows.Core (3)
_generated\209\Windows.Win32.RECT.g.cs (1)
72 internal readonly global::System.Drawing.Size Size => new global::System.Drawing.Size(this.Width, this.Height);
_generated\220\Windows.Win32.SIZE.g.cs (1)
51 public static implicit operator global::System.Drawing.Size(SIZE value) => new global::System.Drawing.Size(value.cx, value.cy);
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
101value = new Size(classInfo.GetInt32("width"), classInfo.GetInt32("height"));
System.Private.Windows.Core.TestUtilities (4)
CommonTestHelper.cs (4)
103data.Add(new Size(new Point(1, 1))); 104data.Add(new Size(1, 2)); 109data.Add(new Size(-1, 1)); 110data.Add(new Size(1, -1));
System.Windows.Forms (325)
System\Windows\Forms\ActiveX\AxHost.cs (2)
324return new Size(75, 23); 1120Size size = new(width, height);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
1692Size size = new(HiMetricToPixel(pSizel->Width, pSizel->Height)); 1703Size adjusted = new(size.Width, size.Height);
System\Windows\Forms\Control.cs (5)
425Size = new Size(width, height); 1270get => new(_clientWidth, _clientHeight); 3100get => new(_width, _height); 5286Size = LayoutUtils.IntersectSizes(new Size(proposedWidth, proposedHeight), maximumSize) 10233Size = SizeFromClientSizeInternal(new(x, y));
System\Windows\Forms\Controls\Buttons\Button.cs (4)
31private Size _systemSize = new(InvalidDimensionValue, InvalidDimensionValue); 250_systemSize = new Size(InvalidDimensionValue, InvalidDimensionValue); 285_systemSize = new Size(InvalidDimensionValue, InvalidDimensionValue); 296_systemSize = new Size(InvalidDimensionValue, InvalidDimensionValue);
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
258protected override Size DefaultSize => new(75, 23);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (6)
121return new Size( 152return new Size( 196Size bordersAndPadding = new(linearBorderAndPadding, linearBorderAndPadding); 201Size checkSize = checkSizeLinear > 0 ? new(checkSizeLinear + 1, checkSizeLinear) : Size.Empty; 204Size textImageInsetSize = new(TextImageInset * 2, TextImageInset * 2); 499size = new Size(size.Width + 1, size.Height + 1);
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\FlatButtonDarkModeRenderer.cs (1)
21private static readonly Size s_corner = new(CornerRadius, CornerRadius);
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\PopupButtonDarkModeRenderer.cs (1)
227path.AddRoundedRectangle(bounds, new Size(radius, radius));
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\SystemButtonDarkModeRenderer.cs (2)
203Rectangle arcRect = new(bounds.Location, new Size(diameter, diameter)); 278path.AddRoundedRectangle(bounds, new Size(radius, radius));
System\Windows\Forms\Controls\Buttons\CheckBox.cs (1)
272protected override Size DefaultSize => new(104, 24);
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (2)
236return new Size(13, 13); 252return new Size(13, 13);
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
237protected override Size DefaultSize => new(104, 24);
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (1)
265return new Size(13, 13);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (5)
386return new Size(121, PreferredHeight); 668set => base.MaximumSize = new Size(value.Width, 0); 674set => base.MinimumSize = new Size(value.Width, 0); 779Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 790Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (1)
33_outerBorder = new Rectangle(_clientRect.Location, new Size(_clientRect.Width - 1, _clientRect.Height - 1));
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
2117protected override Size DefaultSize => new(240, 150);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (5)
9016return new Size(preferredWidth, preferredHeight); 18812Invalidate(new Rectangle(new Point(-pt.X, ColumnHeadersHeight), new Size(-step, ClientSize.Height))); 18823new Size(step, ClientSize.Height))); 18830new Size(-step, ClientSize.Width))); 18837new Size(ClientSize.Width, ClientSize.Height - (pt.Y - rect.Bottom) - step)));
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (5)
284return new Size(-1, -1); 323preferredSize = new Size( 334preferredSize = new Size( 347preferredSize = new Size( 358preferredSize = new Size(
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (14)
1276ScaleHelper.GetIconResourceAsBitmap(typeof(DataGridViewCell), bitmapName, new Size(s_iconsWidth, s_iconsHeight)); 2279return GetPreferredSize(screen, dataGridViewCellStyle, rowIndex, new Size(width, 0)).Height; 2286return new Size(-1, -1); 2298Size constraintSize) => new(-1, -1); 2334return GetPreferredSize(screen, dataGridViewCellStyle, rowIndex, new Size(0, height)).Width; 2341return new Size(-1, -1); 2351return new Size(OwningColumn.Thickness, OwningRow.GetHeight(rowIndex)); 2541Size requiredSize = TextRenderer.MeasureText(text, font, new Size(maxWidth, int.MaxValue), flags); 2565return new Size(0, 0); 2580textSize = TextRenderer.MeasureText(text, font, new Size((int)maxWidth, int.MaxValue), flags); 2609return TextRenderer.MeasureText(text, font, new Size(int.MaxValue, int.MaxValue), flags); 2636textSize = TextRenderer.MeasureText(text, font, new Size((int)maxWidth, maxHeight), flags); 3765editingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height); 3851DataGridView.EditingPanel.Size = new Size(wEditingPanel, hEditingPanel);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (8)
643return new Size(-1, -1); 676preferredSize = new Size(checkBoxSize.Width + borderAndPaddingWidths + 2 * DATAGRIDVIEWCHECKBOXCELL_margin, 0); 682preferredSize = new Size(0, checkBoxSize.Height + borderAndPaddingHeights + 2 * DATAGRIDVIEWCHECKBOXCELL_margin); 688preferredSize = new Size(checkBoxSize.Width + borderAndPaddingWidths + 2 * DATAGRIDVIEWCHECKBOXCELL_margin, 708preferredSize = new Size(checkBoxSize + borderAndPaddingWidths, 0); 714preferredSize = new Size(0, checkBoxSize + borderAndPaddingHeights); 720preferredSize = new Size(checkBoxSize + borderAndPaddingWidths, checkBoxSize + borderAndPaddingHeights); 1202checkBoxSize = new Size(SystemInformation.Border3DSize.Width * 2 + 9, SystemInformation.Border3DSize.Width * 2 + 9);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (10)
486return new Size(-1, -1); 511preferredSize = new Size(0, 0); 516preferredSize = new Size( 527preferredSize = new Size( 557preferredSize = new Size(0, 0); 563glyphSize = new Size(s_sortGlyphWidth + 2 * s_sortGlyphHorizontalMargin, 583preferredSize = new Size( 598preferredSize = new Size( 612preferredSize = new Size( 651preferredSize = new Size(0, 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (2)
537Size adjustedSize = new(size.Width - borderAndPaddingWidths.X - borderAndPaddingWidths.Width, 1167return new Size(-1, -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (4)
349return new Size(-1, -1); 357return new Size(OwningColumn.Thickness, DataGridView.ColumnHeadersHeight); 370return new Size(DataGridView.RowHeadersWidth, OwningRow.GetHeight(rowIndex)); 377return new Size(DataGridView.RowHeadersWidth, DataGridView.ColumnHeadersHeight);
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\DataGridView\DataGridViewLinkCell.cs (5)
541return new Size(-1, -1); 571preferredSize = new Size( 584preferredSize = new Size( 613preferredSize = new Size( 621preferredSize = new Size(
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
84ScaleHelper.GetIconResourceAsBitmap(typeof(DataGridViewHeaderCell), iconName, new Size(s_iconsWidth, s_iconsHeight)); 514return new Size(-1, -1); 855Size maxBounds = new(valBounds.Width - s_iconsWidth - 2 * RowHeaderIconMarginWidth, valBounds.Height);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (6)
393return new Size(-1, -1); 417preferredSize = new Size( 430preferredSize = new Size( 459preferredSize = new Size( 467preferredSize = new Size( 801DataGridView.EditingControl.Size = new Size(editingControlBounds.Width, editingControlBounds.Height);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (1)
140return new Size(-1, -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (5)
202return new Size(preferredWidth, 0); 255return new Size(0, Math.Max(minHeightIcon, minHeightContent) + borderAndPaddingHeights); 278preferredSize = new Size(0, 1); 322Size sizeRequired = TextRenderer.MeasureText(text, font, new Size(int.MaxValue, int.MaxValue), flags); 329Size sizeCell = new(cellBounds.Width, cellBounds.Height);
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (2)
452protected override Size DefaultSize => new(200, PreferredHeight); 1022return new Size(width, height);
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (3)
137protected override Size DefaultSize => new(200, 100); 514textSize = hdc.HDC.MeasureText(Text, hfont, new Size(textRectangle.Width, int.MaxValue), (TextFormatFlags)flags); 602Size totalPadding = borderSize + new Size(0, _fontHeight) + Padding.Size;
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (2)
185new Size(textBounds.Width, textBounds.Height), 288new Size(textBounds.Width, textBounds.Height),
System\Windows\Forms\Controls\ImageList\ImageList.cs (3)
27private static readonly Size s_defaultImageSize = new(16, 16); 169_imageSize = new Size(value.Width, value.Height); 217_imageSize = new Size(x, y);
System\Windows\Forms\Controls\Labels\Label.cs (4)
316protected override Size DefaultSize => new(100, AutoSize ? PreferredHeight : 23); 837Size preferredSize = (AutoSize) ? PreferredSize : new Size(saveWidth, saveHeight); 1022bordersAndPadding += new Size(2, 2); 1270Size preferredSize = GetPreferredSize(new Size(clientRect.Width, clientRect.Height));
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
560Size clientSize = new(clientRectWithPadding.Width, clientRectWithPadding.Height); 985Size preferredSize = GetPreferredSize(new Size(clientRect.Width, clientRect.Height));
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (4)
378return new Size(120, 96); 602Size = new Size(oldSize.Width + 1, oldSize.Height); 766width = SizeFromClientSize(new Size(MaxItemWidth, height)).Width; 774return new Size(width, height) + Padding.Size;
System\Windows\Forms\Controls\ListView\ListView.cs (1)
752return new Size(121, 97);
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\Menus\MenuStrip.cs (2)
68ScaleHelper.ScaleToDpi(new Size(200, 24), DeviceDpi) : 69new Size(200, 24);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (5)
84private static readonly Size s_defaultSingleMonthSize = new(176, 153); 98private Size _dimensions = new(1, 1); 803return new Size(rect.right, rect.bottom); 1603private void ResetCalendarDimensions() => CalendarDimensions = new Size(1, 1); 1901=> !_dimensions.Equals(new Size(1, 1));
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
220protected override Size DefaultSize => new(100, 50);
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
188protected override Size DefaultSize => new(100, 23);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (4)
100private static readonly Size s_defaultLargeButtonSize = new(32, 32); 101private static readonly Size s_defaultNormalButtonSize = new(16, 16); 545protected override Size DefaultSize => new(130, 130); 2755_gridView.Size = new Size(Size.Width, endSize - _gridView.Location.Y);
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\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (2)
54Size = new(LogicalToDeviceUnits(LogicalDefaultWidth), LogicalToDeviceUnits(LogicalDefaultHeight)); 72Size = new(Width, 1 + value * _lineHeight);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (10)
230? new(SystemInformation.VerticalScrollBarArrowHeightForDpi(DeviceDpiInternal), RowHeight) 231: new(SystemInformation.VerticalScrollBarArrowHeight, RowHeight); 277? new Size(SystemInformation.VerticalScrollBarArrowHeightForDpi(DeviceDpiInternal), RowHeight) 278: new Size(SystemInformation.VerticalScrollBarArrowHeight, RowHeight); 961Size size = new(width, height); 1991Size sizeWindow = new(rect.Width, rect.Height); 4357? new Size(SystemInformation.VerticalScrollBarArrowHeightForDpi(DeviceDpiInternal), RowHeight) 4358: new Size(SystemInformation.VerticalScrollBarArrowHeight, RowHeight); 5170_dropDownButton.Size = new(SystemInformation.VerticalScrollBarArrowHeightForDpi(DeviceDpiInternal), RowHeight); 5174_dropDownButton.Size = new(SystemInformation.VerticalScrollBarArrowHeight, RowHeight);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (3)
41new(SystemInformation.VerticalScrollBarWidth * 4, SystemInformation.HorizontalScrollBarHeight * 4); 297Size newSize = new(2 * DropDownHolderBorder + _currentControl.Width, 2 * DropDownHolderBorder + _currentControl.Height); 600Size size = new(2 * DropDownHolderBorder + control.Width, 2 * DropDownHolderBorder + control.Height);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
350protected override Size DefaultSize => new(100, 96);
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
94return new Size(DefaultWidth, DefaultWidth);
System\Windows\Forms\Controls\TabControl\TabControl.cs (2)
233return new Size(200, 100); 1535Size = new Size(size.Width + 1, size.Height);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (2)
487return new Size(100, PreferredHeight); 826bordersAndPadding += new Size(0, 3);
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (1)
65return new Size(200, 22);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (7)
26private static Size s_onePixel = new(1, 1); 123_imageScalingSize = new Size(s_iconSize, s_iconSize); 540? ScaleHelper.ScaleToDpi(new Size(100, 25), DeviceDpi) 541: new Size(100, 25); 3770_imageScalingSize = new Size(s_iconSize, s_iconSize); 4027CommonProperties.SetMinimumSize(this, new Size(-1, -1)); 4460Size invalidDefaultSize = new(-1, -1);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (1)
105protected override Size DefaultSize => new(100, 22);
System\Windows\Forms\Controls\ToolStrips\ToolStripContainer.cs (1)
234return new Size(150, 175);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (1)
13private static readonly Size s_logicalDropDownArrowSize = new(5, 3);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (2)
339maxArrowSize = new Size(_arrowSize, _maxItemSize.Height); 605_defaultImageSize = new(defaultImageSize, defaultImageSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (2)
82preferredSize = new Size(ParentInternal.Width, GripThickness); 86preferredSize = new Size(GripThickness, ParentInternal.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (2)
686ScaleHelper.ScaleToDpi(new Size(23, 23), DeviceDpi) : 687new Size(23, 23);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (1)
20private static readonly Size s_invalidSize = new(int.MinValue, int.MinValue);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (3)
53private static readonly Size s_checkMarkBitmapSize = new(16, 16); 215? ScaleHelper.ScaleToDpi(new Size(32, 19), DeviceDpi) 216: new Size(32, 19);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
343return new Size(_minAllowedWidth, _minAllowedWidth);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (2)
21private static readonly Size s_onePix = new(1, 1); 860Rectangle bottomLeftParentHorizontalPixels = new(bottomLeft, new Size(2, 1));
System\Windows\Forms\Controls\ToolStrips\ToolStripProgressBar.cs (2)
75return new Size(100, 15); 240Size = new Size(100, 15)
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (1)
15private static readonly Size s_defaultBitmapSize = new(16, 16);
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (5)
54protected override Size DefaultSize => new(SeparatorThickness, SeparatorThickness); 263return new Size(SeparatorThickness, SeparatorThickness); 268return new Size(parent.Width - (parent.Padding.Horizontal - dropDownMenu.ImageMargin.Width), SeparatorThickness); 282return new Size(SeparatorThickness, constrainingSize.Height); 285return new Size(constrainingSize.Width, SeparatorThickness);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (2)
301Rectangle dropDownButtonBounds = new(Point.Empty, new Size(Math.Min(Width, DropDownButtonWidth), Height)); 307Rectangle splitButtonButtonBounds = new(Point.Empty, new Size(splitButtonButtonWidth, splitButtonButtonHeight));
System\Windows\Forms\Controls\ToolStrips\ToolStripStatusLabel.cs (1)
181return base.GetPreferredSize(constrainingSize) + new Size(4, 4);
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.cs (2)
77protected override Size DefaultSize => new Size(100, 22); 93return new Size(bounds.Width, TextBox.PreferredHeight);
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
200protected override Size DefaultSize => new(104, PreferredDimension);
System\Windows\Forms\Controls\TreeView\TreeView.cs (3)
90s_stateImageSize = new(imageSize, imageSize); 413protected override Size DefaultSize => new(121, 97); 2817bounds = new Rectangle(textLoc, new Size(textSize.Width, bounds.Height));
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (2)
515width = SizeFromClientSizeInternal(new(width, height)).Width + _upDownButtons.Width; 516return new Size(width, height) + Padding.Size;
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (2)
825int width = SizeFromClientSizeInternal(new(textWidth, height)).Width + _upDownButtons.Width; 826return new Size(width, height) + Padding.Size;
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (5)
62_upDownButtons.Size = new Size(_defaultButtonsWidth, PreferredHeight); 244protected override Size DefaultSize => new(DefaultControlWidth, PreferredHeight); 284set => base.MaximumSize = new Size(value.Width, 0); 290set => base.MinimumSize = new Size(value.Width, 0); 848upDownEditBounds.Size = new Size(clientArea.Width - _defaultButtonsWidth, clientArea.Height);
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (1)
372if (_cachedBitmap is null || _cachedBitmap.Size != new Size(width, height))
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (1)
197return new(offsetWidth, offsetHeight);
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1125protected override Size DefaultSize => new(250, 250);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (2)
1078Size sz = new(width, height); 1185protected override Size DefaultSize => new(75, 23);
System\Windows\Forms\Design\ComponentEditorForm.cs (4)
184ImageSize = new Size(16, 16) 253Size size = new(bounds.Width + 3 * (BUTTON_PAD + xFrame) + selectorWidth, 306AutoScaleBaseSize = new Size(5, 14); 341_maxSize = new Size(3 * (BUTTON_WIDTH + BUTTON_PAD), 24 * _pageTypes.Length);
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (3)
208Size textSize = new(_scaledMaxWidth - _scaledPaddingWidth, int.MaxValue); 253ClientSize = new Size(width, buttonTop + _scaledButtonTopPadding); 257_pictureBox.Size = new Size(_scaledPictureWidth * 3 / 4, _scaledPictureHeight * 3 / 4);
System\Windows\Forms\Form.cs (6)
445return new Size((int)Math.Round(real.Width), (int)Math.Round(real.Height)); 882protected override Size DefaultSize => new Size(300, 300); 1236Size = new Size(Math.Min(size.Width, value.Width), Math.Min(size.Height, value.Height)); 1353Size = new Size(Math.Max(size.Width, value.Width), Math.Max(size.Height, value.Height)); 3044Size newVar = new((int)Math.Round(newVarF.Width), (int)Math.Round(newVarF.Height)); 4520_dpiFormSizes.Add(e.DeviceDpiNew, new Size(e.SuggestedRectangle.Width, e.SuggestedRectangle.Height));
System\Windows\Forms\Input\Cursor.cs (2)
383return new Size(bitmap.bmWidth, bitmap.bmHeight); 388return new Size(bitmap.bmWidth, bitmap.bmHeight / 2);
System\Windows\Forms\Internal\WinFormsUtils.cs (1)
82bounds.Size = new Size(Math.Min(constrainingBounds.Width - 2, bounds.Width),
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\DefaultLayout.cs (4)
492Size neededSize = new( 543Size newSize = xGetDockedSize(element, /* constraints = */ new Size(remainingSize.Width, 1)); 560Size newSize = xGetDockedSize(element, /* constraints = */ new Size(1, remainingSize.Height)); 606preferredSize = new Size(-7103, -7105);
System\Windows\Forms\Layout\FlowLayout.cs (3)
187Size elementConstraints = new(int.MaxValue, rowBounds.Height - elementProxy.Margin.Size.Height); 197elementConstraints = LayoutUtils.UnionSizes(new Size(1, 1), elementConstraints); 226Rectangle cellBounds = new(location, new Size(requiredSize.Width, rowBounds.Height));
System\Windows\Forms\Layout\LayoutUtils.cs (6)
13public static readonly Size s_maxSize = new(int.MaxValue, int.MaxValue); 14public static readonly Size s_invalidSize = new(int.MinValue, int.MinValue); 50Size textSize = TextRenderer.MeasureText(obj.ToString(), font, new Size(short.MaxValue, short.MaxValue), TextFormatFlags.SingleLine); 207return new Size( 214return new Size( 356Size stretchedSize = new(
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\Panels\Panel.cs (1)
145protected override Size DefaultSize => new(200, 100);
System\Windows\Forms\Printing\PrintControllerWithStatusDialog.StatusDialog.cs (4)
40Size = new Size(240, 64), 47Size = ScaleHelper.ScaleToDpi(new Size(75, 23), ScaleHelper.InitialSystemDpi), 72AutoScaleDimensions = new Size(6, 13); 77ClientSize = ScaleHelper.ScaleToDpi(new Size(256, 122), ScaleHelper.InitialSystemDpi);
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));
System\Windows\Forms\Printing\PrintPreviewDialog.cs (4)
53base.AutoScaleBaseSize = new Size(5, 13); 381protected override Size DefaultMinimumSize => new(375, 250); 910_previewControl.Size = new Size(792, 610); 970ClientSize = new Size(400, 300);
System\Windows\Forms\Rendering\ControlPaint_ModernControlButtonRenderer.cs (2)
100Size radius = new(4, 4); 116Size radius = new(4, 4);
System\Windows\Forms\Rendering\TextRenderer.cs (1)
23internal static Size MaxSize { get; } = new(int.MaxValue, int.MaxValue);
System\Windows\Forms\Scrolling\HScrollBar.cs (1)
24=> new(80, SystemInformation.HorizontalScrollBarHeight);
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
957_requestedScrollMargin = new Size(x, y);
System\Windows\Forms\Scrolling\VScrollBar.cs (2)
33return new Size( 38return new Size(SystemInformation.VerticalScrollBarWidth, DefaultHeight);
System\Windows\Forms\SystemInformation.cs (5)
101? new(PInvoke.GetCurrentSystemMetrics(SM_CXBORDER, (uint)dpi), 595=> new(PInvokeCore.SystemParametersInfoInt(SPI_GETMOUSEHOVERWIDTH), 770? new Size(data.iSmCaptionWidth, data.iSmCaptionHeight) 785? new Size(data.iMenuWidth, data.iMenuHeight) 815=> new(PInvokeCore.GetSystemMetrics(x), PInvokeCore.GetSystemMetrics(y));
System\Windows\Forms\ToolTip\ToolTip.cs (1)
1542bubbleSize = new Size(result.LOWORD, result.HIWORD);
System\Windows\Forms\UserControl.cs (1)
184return new Size(150, 150);
System.Windows.Forms.Design (113)
System\ComponentModel\Design\BinaryEditor.BinaryUI.cs (2)
185_buttonOK.MinimumSize = new Size(75, 23); 195_buttonSave.MinimumSize = new Size(75, 23);
System\ComponentModel\Design\ByteViewer.cs (2)
442Size = new Size( 562Size = new Size(
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (1)
64return preferredSize + new Size(PushButtonWidth, 0);
System\ComponentModel\Design\DesignerActionPanel.CheckBoxPropertyLine.cs (2)
36Size checkBoxPreferredSize = _checkBox.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)); 43return checkBoxPreferredSize + new Size(LineLeftMargin + LineRightMargin, LineVerticalPadding);
System\ComponentModel\Design\DesignerActionPanel.cs (2)
117MinimumSize = new Size(150, 0); 391return new Size(panelWidth, yPos + BottomPadding);
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
175_button.Size = new Size(buttonHeight, buttonHeight);
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (2)
45Size linkLabelSize = _linkLabel.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)); 52return linkLabelSize + new Size(LineLeftMargin + LineRightMargin, LineVerticalPadding);
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (3)
56Size titleSize = _titleLabel.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)); 60subtitleSize = _subtitleLabel.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)); 74return new Size(newWidth + 2, newHeight + 1);
System\ComponentModel\Design\DesignerActionPanel.SeparatorLine.cs (1)
24public override Size LayoutControls(int top, int width, bool measureOnly) => new(MinimumWidth, 1);
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (6)
83return LineLeftMargin + _label.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)).Width + TextBoxLineCenterMargin; 94int textBoxPreferredHeight = _textBox.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)).Height; 107_editRegionSize = new Size(EditInputWidth + textBoxWidthBonus, textBoxPreferredHeight + TextBoxLineInnerPadding * 2); 110int labelPreferredWidth = _label.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)).Width; 111_label.Size = new Size(labelPreferredWidth, height); 119return new Size(width, height);
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (2)
40Size labelSize = _label.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)); 47return labelSize + new Size(LineLeftMargin + LineRightMargin, LineVerticalPadding);
System\ComponentModel\Design\DesignerActionUI.cs (1)
616if ((new Rectangle(glyphCoord, new Size(currentGlyph.Bounds.Width, currentGlyph.Bounds.Height))).Contains(point))
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (1)
35Size panelSize = CurrentPanel.GetPreferredSize(new Size(150, int.MaxValue));
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (4)
173ClientSize = new Size(ClientSize.Width + requestedDelta, MinimumSize.Height); 190return new Size(rect.Width + CaretPadding, rect.Height); 240_minimumSize = new Size( 366_watermarkSize = new Size((int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height));
System\Drawing\Design\ColorEditor.ColorPalette.cs (1)
72Size = new Size(
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
89Size = new Size(size.Width + 2 * CMARGIN, size.Height + 2 * CMARGIN + rectItemSize.Height);
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (10)
221Size = new Size(pixel_125, pixel_89); 223_topLeft.Size = new Size(pixel_24, pixel_25); 226_topCenter.Size = new Size(pixel_59, pixel_25); 229_topRight.Size = new Size(pixel_24, pixel_25); 232_middleLeft.Size = new Size(pixel_24, pixel_25); 235_middleCenter.Size = new Size(pixel_59, pixel_25); 238_middleRight.Size = new Size(pixel_24, pixel_25); 241_bottomLeft.Size = new Size(pixel_24, pixel_25); 244_bottomCenter.Size = new Size(pixel_59, pixel_25); 247_bottomRight.Size = new Size(pixel_24, pixel_25);
System\Drawing\Design\ToolboxItem.cs (1)
607itemBitmap = new Bitmap(itemBitmap, new Size(s_iconWidth, s_iconHeight));
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (6)
87_container.Size = new Size(pixel_90, pixel_90); 91_control.Size = new Size(pixel_30, pixel_30); 95_right.Size = new Size(pixel_30 - XBORDER, pixel_10); 102_left.Size = new Size(pixel_30 - XBORDER, pixel_10); 109_top.Size = new Size(pixel_10, pixel_30 - YBORDER); 116_bottom.Size = new Size(pixel_10, pixel_30 - YBORDER);
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (1)
179Size delta = new(Math.Abs(mouseLoc.X - InitialDragPoint.X), Math.Abs(mouseLoc.Y - InitialDragPoint.Y));
System\Windows\Forms\Design\Behavior\DesignerActionGlyph.cs (2)
102ScaleHelper.ScaleToDpi(new Size(IconSize, IconSize), ScaleHelper.InitialSystemDpi)); 107ScaleHelper.ScaleToDpi(new Size(IconSize, IconSize), ScaleHelper.InitialSystemDpi));
System\Windows\Forms\Design\ComponentTray.cs (1)
1706return new Size(8, 8);
System\Windows\Forms\Design\ControlCommandSet.cs (2)
641primaryControlsize += new Size(snappedOffset.X, snappedOffset.Y); 786size += new Size(moveOffsetX, offsetY);
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (2)
47_sampleDataGridViewSelected.Size = new Drawing.Size(100, Font.Height + 9); 48_sampleDataGridView.Size = new Drawing.Size(100, Font.Height + 9);
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
455Size = new Size(
System\Windows\Forms\Design\DesignerOptions.cs (1)
16private Size _gridSize = new(8, 8);
System\Windows\Forms\Design\DesignerToolStripControlHost.cs (1)
32get => new(92, 22);
System\Windows\Forms\Design\DesignerUtils.cs (3)
343AdornmentType.GrabHandle => new Size(s_handleSize, s_handleSize), 344AdornmentType.ContainerSelector or AdornmentType.Maximum => new Size(s_containerGrabHandleSize, s_containerGrabHandleSize), 345_ => new Size(0, 0),
System\Windows\Forms\Design\DockEditor.DockUI.cs (3)
191_none.Size = ScaleHelper.ScaleToDpi(new Size(LogicalNoneWidth, LogicalNoneHeight), dpi); 195_container.Size = ScaleHelper.ScaleToDpi(new Size(LogicalContainerSize, LogicalContainerSize), dpi); 197Size scaledButtonSize = ScaleHelper.ScaleToDpi(new Size(LogicalButtonSize, LogicalButtonSize), dpi);
System\Windows\Forms\Design\FormatControl.cs (5)
351thirdRowLabel.MaximumSize = new Drawing.Size(tableLayoutPanel1.Width, 0); 360tableLayoutPanel1.MinimumSize = new Drawing.Size(tableLayoutPanel1.Width, tableLayoutPanel1.Height); 384nullValueLabel.MinimumSize = new Drawing.Size(minWidth, minHeight); 385secondRowLabel.MinimumSize = new Drawing.Size(minWidth, minHeight); 409explanationLabel.Size = new Drawing.Size(formatGroupBox.Width - 10, 30);
System\Windows\Forms\Design\FormatControl.Designer.cs (4)
93sampleGroupBox.MinimumSize = new System.Drawing.Size(250, 38); 117secondRowLabel.MinimumSize = new System.Drawing.Size(81, 14); 123nullValueLabel.MinimumSize = new System.Drawing.Size(81, 14); 176MinimumSize = new System.Drawing.Size(390, 237);
System\Windows\Forms\Design\FormatStringDialog.cs (4)
177_formatControl1.Size = new Drawing.Size(376, 268); 184_cancelButton.Size = new Drawing.Size(87, 23); 194_okButton.Size = new Drawing.Size(87, 23); 204ClientSize = new Drawing.Size(396, 295);
System\Windows\Forms\Design\FormDocumentDesigner.cs (6)
66return new Size((int)Math.Round(real.Width), (int)Math.Round(real.Height)); 102return new Size(-1, -1); 106Size size = new(-1, -1); 269Size newVar = new((int)Math.Round(newVarF.Width), (int)Math.Round(newVarF.Height)); 443ClientSize = new Size(clientWidth, clientHeight); 483properties["ClientSize"] = TypeDescriptor.CreateProperty(typeof(FormDocumentDesigner), prop, new DefaultValueAttribute(new Size(-1, -1)));
System\Windows\Forms\Design\MaskDesignerDialog.cs (2)
190_btnOK.MinimumSize = new Drawing.Size(75, 23); 199_btnCancel.MinimumSize = new Drawing.Size(75, 23);
System\Windows\Forms\Design\MaskedTextBoxTextEditorDropDown.cs (1)
52Size = new Drawing.Size(100, 52);
System\Windows\Forms\Design\OleDragDropHandler.CfCodeToolboxItem.cs (1)
109defaultValues["Offset"] = new Size(childControl.Bounds.X - bounds.X, childControl.Bounds.Y - bounds.Y);
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
193defaultValues["Size"] = new Size(width, height);
System\Windows\Forms\Design\ParentControlDesigner.cs (6)
218_gridSize = new Size(8, 8); 436Size offset = new(0, 0); 567prop?.SetValue(newChild, new Size(bounds.Width, bounds.Height)); 984return (new Size(75, 23)); 1301defaultValue = new Size(8, 8); 1855Size minControlSize = new(DesignerUtils.MinDragSize.Width * 2, DesignerUtils.MinDragSize.Height * 2);
System\Windows\Forms\Design\SelectionUIHandler.cs (2)
287minSize = new Size(1, 1); 454Size size = new(Math.Max(MinControlWidth, newBounds.Width), Math.Max(MinControlHeight, newBounds.Height));
System\Windows\Forms\Design\SelectionUIService.cs (3)
1193AdornmentType.GrabHandle => new Size(SelectionUIItem.GRABHANDLE_WIDTH, SelectionUIItem.GRABHANDLE_HEIGHT), 1194AdornmentType.ContainerSelector or AdornmentType.Maximum => new Size(ContainerSelectionUIItem.CONTAINER_WIDTH, ContainerSelectionUIItem.CONTAINER_HEIGHT), 1195_ => new Size(0, 0),
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (1)
232Size = new Size(Size.Width + _resetButton.Size.Width - resetButtonSize.Width, Size.Height);
System\Windows\Forms\Design\StyleEditorForm.cs (5)
212_addButton.MinimumSize = new Size(75, 23); 220_removeButton.MinimumSize = new Size(75, 23); 228_insertButton.MinimumSize = new Size(75, 23); 247_okButton.MinimumSize = new Size(75, 23); 256_cancelButton.MinimumSize = new Size(75, 23);
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (1)
708imageBounds.Size = new(s_iconWidth, s_iconHeight);
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 (1)
960Size dragSize = new(1, 1);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
1635return new Size(Width, s_toolStripTempateHeight); 1639return new Size(Width, s_templateHeight);
System\Windows\Forms\Design\VsPropertyGrid.cs (1)
10private static readonly Size s_defaultIconSize = new(16, 16);
System.Windows.Forms.Primitives (5)
System\Windows\Forms\Internals\ScaleHelper.cs (4)
303: new(ScaleToDpi(logicalSize.Width, dpi), ScaleToDpi(logicalSize.Height, dpi)); 305internal static Size SystemIconSize => new( 310? new( 313: new(16, 16);
System\Windows\Forms\Padding.cs (1)
128public readonly Size Size => new(Horizontal, Vertical);
WindowsFormsIntegration (6)
System\Windows\Integration\Convert.cs (2)
260return new SD.Size(Convert.ToBoundedInt(size.Width), 268return new SD.Size(Convert.ToBoundedInt(size.Width),
System\Windows\Integration\ElementHost.cs (2)
130return new SD.Size(200, 100); 317MaximumSize = HostUtils.ConvertUnboundedToZero(new SD.Size(maxWidth, maxHeight));
System\Windows\Integration\HostUtils.cs (2)
71return new SD.Size( 78return new SD.Size(
1496 references to Size
Microsoft.Extensions.AI (1)
ChatCompletion\OpenTelemetryImageGenerator.cs (1)
175if (options.ImageSize is Size size)
Microsoft.Extensions.AI.Abstractions (1)
Image\ImageGenerationOptions.cs (1)
49public Size? ImageSize { get; set; }
Microsoft.Extensions.AI.OpenAI (2)
OpenAIImageGenerator.cs (2)
103/// Converts a <see cref="Size"/> to an OpenAI <see cref="GeneratedImageSize"/>. 107private static GeneratedImageSize? ToOpenAIImageSize(Size? requestedSize) =>
Microsoft.Private.Windows.Core (27)
_generated\206\Windows.Win32.RECT.g.cs (2)
44 internal RECT(global::System.Drawing.Point location, global::System.Drawing.Size size) : 72 internal readonly global::System.Drawing.Size Size => new global::System.Drawing.Size(this.Width, this.Height);
_generated\217\Windows.Win32.SIZE.g.cs (3)
33 internal SIZE(global::System.Drawing.Size value) : this(value.Width, value.Height) 51 public static implicit operator global::System.Drawing.Size(SIZE value) => new global::System.Drawing.Size(value.cx, value.cy); 53 public static implicit operator SIZE(global::System.Drawing.Size value) => new SIZE(value);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (4)
173/// Writes a <see cref="Size"/> in binary format. 175public static void WriteSize(Stream stream, Size value) 180new ClassInfo(1, typeof(Size).FullName!, s_sizeMemberNames), 740case Size size:
System\Private\Windows\Graphics\IBitmap.cs (1)
21Size Size { get; }
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (2)
94{ Types.ToTypeName($"{Types.SizeType}"), typeof(Size) }, 161|| type == typeof(Size)
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
83/// Tries to get this object as a <see cref="Size"/>. 94|| !classInfo.TypeNameMatches(typeof(Size))
System\Value.cs (9)
399public Value(Size value) 405public Value(Size? value) 418public static implicit operator Value(Size value) => new(value); 419public static explicit operator Size(in Value value) => value.GetValue<Size>(); 420public static implicit operator Value(Size? value) => new(value); 421public static explicit operator Size?(in Value value) => value.GetValue<Size?>(); 713|| (typeof(T) == typeof(Size) && _object == TypeFlags.Size)
System\Value.TypeFlags.cs (2)
28internal static StraightCastFlag<Size> Size { get; } = StraightCastFlag<Size>.Instance;
System\Value.Union.cs (1)
38[FieldOffset(0)] public Size Size;
Windows\Win32\Foundation\RECT.cs (1)
10public RECT(Size size)
netstandard (1)
netstandard.cs (1)
754[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Size))]
PresentationUI (3)
MS\Internal\Documents\RMPublishingDialog.cs (2)
504images.ImageSize = System.Drawing.Size.Subtract( 913System.Drawing.Size imageButtonSize = new System.Drawing.Size(
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (1)
1037System.Drawing.Size boxSize = CheckBoxRenderer.GetGlyphSize(graphics, state);
System.ComponentModel.TypeConverter (3)
System\Drawing\SizeConverter.cs (3)
60if (value is Size size) 77ConstructorInfo? ctor = typeof(Size).GetConstructor([typeof(int), typeof(int)]); 110PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(Size), attributes);
System.Data.Common (1)
System\Data\TypeLimiter.cs (1)
179typeof(Size),
System.Drawing (1)
System.Drawing.cs (1)
143[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Size))]
System.Drawing.Common (51)
misc\DpiHelper.cs (5)
103private static Bitmap ScaleBitmapToSize(Bitmap logicalImage, Size deviceImageSize) 131Size deviceImageSize = LogicalToDeviceUnits(logicalImage.Size); 175public static Size LogicalToDeviceUnits(Size logicalSize) => 185public static Bitmap? CreateResizedBitmap(Bitmap? logicalImage, Size targetImageSize)
Special\Forwards.cs (1)
12[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Size))]
System\Drawing\Bitmap.cs (2)
116public Bitmap(Image original, Size newSize) : this(original, newSize.Width, newSize.Height) 236Size size = Size;
System\Drawing\BufferedGraphics.cs (2)
21private readonly Size _virtualSize; 27IntPtr targetDC, Point targetLoc, Size virtualSize)
System\Drawing\BufferedGraphicsContext.cs (7)
15private Size _maximumBuffer; 16private Size _bufferSize = Size.Empty; 17private Size _virtualSize; 47public Size MaximumBuffer 479_bufferSize = Size.Empty; 480_virtualSize = Size.Empty;
System\Drawing\Drawing2D\GraphicsPath.cs (1)
661public void AddRoundedRectangle(Rectangle rect, Size radius) =>
System\Drawing\Graphics.cs (6)
722public void DrawRoundedRectangle(Pen pen, Rectangle rect, Size radius) => 1196public void FillRoundedRectangle(Brush brush, Rectangle rect, Size radius) => 2433public void CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize) => 2439public void CopyFromScreen(int sourceX, int sourceY, int destinationX, int destinationY, Size blockRegionSize) => 2446public void CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation) => 2706public void CopyFromScreen(int sourceX, int sourceY, int destinationX, int destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
System\Drawing\Icon.cs (13)
32private Size _iconSize = Size.Empty; 59public Icon(string fileName, Size size) : this(fileName, size.Width, size.Height) 74public Icon(Icon original, Size size) : this(original, size.Width, size.Height) 111public Icon(Stream stream, Size size) : this(stream, size.Width, size.Height) 128_iconSize = (Size)info.GetValue("IconSize", typeof(Size))!; 146si.AddValue("IconSize", _iconSize, typeof(Size)); 192public unsafe Size Size 283Size cursorSize = Size; 354Size size = Size; 737Size size = Size; 824/// Without the original source data the <see cref="Icon(Icon, Size)">copy constructors</see> have to resample
System\Drawing\Image.cs (1)
421public Size Size => new(Width, Height);
System\Drawing\Printing\PreviewPageInfo.cs (4)
14private Size _physicalSize = Size.Empty; 19public PreviewPageInfo(Image image, Size physicalSize) 33public Size PhysicalSize => _physicalSize;
System\Drawing\Printing\PreviewPrintController.cs (2)
52Size size = e.PageBounds.Size; 56Size metafileSize = PrinterUnitConvert.Convert(size, PrinterUnit.Display, PrinterUnit.HundredthsOfAMillimeter);
System\Drawing\Printing\PrinterSettings.cs (3)
875Span<Size> sizes = stackalloc Size[count]; 876fixed (Size* s = sizes)
System\Drawing\Printing\PrinterUnitConvert.cs (2)
40public static Size Convert(Size value, PrinterUnit fromUnit, PrinterUnit toUnit) =>
System\Drawing\ToolboxBitmapAttribute.cs (2)
19private static readonly Size s_largeSize = new(32, 32); 20private static readonly Size s_smallSize = new(16, 16);
System.Drawing.Primitives (106)
System\Drawing\Point.cs (12)
35/// Initializes a new instance of the <see cref='System.Drawing.Point'/> class from a <see cref='System.Drawing.Size'/> . 37public Point(Size sz) 82/// Creates a <see cref='System.Drawing.Size'/> with the coordinates of the specified <see cref='System.Drawing.Point'/> . 84public static explicit operator Size(Point p) => new Size(p.X, p.Y); 87/// Translates a <see cref='System.Drawing.Point'/> by a given <see cref='System.Drawing.Size'/> . 89public static Point operator +(Point pt, Size sz) => Add(pt, sz); 92/// Translates a <see cref='System.Drawing.Point'/> by the negative of a given <see cref='System.Drawing.Size'/> . 94public static Point operator -(Point pt, Size sz) => Subtract(pt, sz); 111/// Translates a <see cref='System.Drawing.Point'/> by a given <see cref='System.Drawing.Size'/> . 113public static Point Add(Point pt, Size sz) => new Point(unchecked(pt.X + sz.Width), unchecked(pt.Y + sz.Height)); 116/// Translates a <see cref='System.Drawing.Point'/> by the negative of a given <see cref='System.Drawing.Size'/> . 118public static Point Subtract(Point pt, Size sz) => new Point(unchecked(pt.X - sz.Width), unchecked(pt.Y - sz.Height));
System\Drawing\PointF.cs (8)
84/// Translates a <see cref='System.Drawing.PointF'/> by a given <see cref='System.Drawing.Size'/> . 86public static PointF operator +(PointF pt, Size sz) => Add(pt, sz); 89/// Translates a <see cref='System.Drawing.PointF'/> by the negative of a given <see cref='System.Drawing.Size'/> . 91public static PointF operator -(PointF pt, Size sz) => Subtract(pt, sz); 118/// Translates a <see cref='System.Drawing.PointF'/> by a given <see cref='System.Drawing.Size'/> . 120public static PointF Add(PointF pt, Size sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); 123/// Translates a <see cref='System.Drawing.PointF'/> by the negative of a given <see cref='System.Drawing.Size'/> . 125public static PointF Subtract(PointF pt, Size sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height);
System\Drawing\Rectangle.cs (3)
39public Rectangle(Point location, Size size) 72public Size Size 259public void Inflate(Size size) => Inflate(size.Width, size.Height);
System\Drawing\Size.cs (81)
15public struct Size : IEquatable<Size> 18/// Initializes a new instance of the <see cref='System.Drawing.Size'/> class. 20public static readonly Size Empty; 26/// Initializes a new instance of the <see cref='System.Drawing.Size'/> class from the specified 36/// Initializes a new instance of the <see cref='System.Drawing.Size'/> class from the specified dimensions. 45/// Converts the specified <see cref='System.Drawing.Size'/> to a <see cref='System.Drawing.SizeF'/>. 47public static implicit operator SizeF(Size p) => new SizeF(p.Width, p.Height); 50/// Performs vector addition of two <see cref='System.Drawing.Size'/> objects. 52public static Size operator +(Size sz1, Size sz2) => Add(sz1, sz2); 55/// Contracts a <see cref='System.Drawing.Size'/> by another <see cref='System.Drawing.Size'/> 57public static Size operator -(Size sz1, Size sz2) => Subtract(sz1, sz2); 60/// Multiplies a <see cref="Size"/> by an <see cref="int"/> producing <see cref="Size"/>. 63/// <param name="right">Multiplicand of type <see cref="Size"/>.</param> 64/// <returns>Product of type <see cref="Size"/>.</returns> 65public static Size operator *(int left, Size right) => Multiply(right, left); 68/// Multiplies <see cref="Size"/> by an <see cref="int"/> producing <see cref="Size"/>. 70/// <param name="left">Multiplicand of type <see cref="Size"/>.</param> 72/// <returns>Product of type <see cref="Size"/>.</returns> 73public static Size operator *(Size left, int right) => Multiply(left, right); 76/// Divides <see cref="Size"/> by an <see cref="int"/> producing <see cref="Size"/>. 78/// <param name="left">Dividend of type <see cref="Size"/>.</param> 80/// <returns>Result of type <see cref="Size"/>.</returns> 81public static Size operator /(Size left, int right) => new Size(unchecked(left.width / right), unchecked(left.height / right)); 84/// Multiplies <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 87/// <param name="right">Multiplicand of type <see cref="Size"/>.</param> 89public static SizeF operator *(float left, Size right) => Multiply(right, left); 92/// Multiplies <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 94/// <param name="left">Multiplicand of type <see cref="Size"/>.</param> 97public static SizeF operator *(Size left, float right) => Multiply(left, right); 100/// Divides <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 102/// <param name="left">Dividend of type <see cref="Size"/>.</param> 105public static SizeF operator /(Size left, float right) 109/// Tests whether two <see cref='System.Drawing.Size'/> objects are identical. 111public static bool operator ==(Size sz1, Size sz2) => sz1.Width == sz2.Width && sz1.Height == sz2.Height; 114/// Tests whether two <see cref='System.Drawing.Size'/> objects are different. 116public static bool operator !=(Size sz1, Size sz2) => !(sz1 == sz2); 119/// Converts the specified <see cref='System.Drawing.Size'/> to a <see cref='System.Drawing.Point'/>. 121public static explicit operator Point(Size size) => new Point(size.Width, size.Height); 124/// Tests whether this <see cref='System.Drawing.Size'/> has zero width and height. 130/// Represents the horizontal component of this <see cref='System.Drawing.Size'/>. 139/// Represents the vertical component of this <see cref='System.Drawing.Size'/>. 148/// Performs vector addition of two <see cref='System.Drawing.Size'/> objects. 150public static Size Add(Size sz1, Size sz2) => 156public static Size Ceiling(SizeF value) => 160/// Contracts a <see cref='System.Drawing.Size'/> by another <see cref='System.Drawing.Size'/> . 162public static Size Subtract(Size sz1, Size sz2) => 168public static Size Truncate(SizeF value) => new Size(unchecked((int)value.Width), unchecked((int)value.Height)); 173public static Size Round(SizeF value) => 177/// Tests to see whether the specified object is a <see cref='System.Drawing.Size'/> with the same dimensions 178/// as this <see cref='System.Drawing.Size'/>. 180public override readonly bool Equals([NotNullWhen(true)] object? obj) => obj is Size && Equals((Size)obj); 182public readonly bool Equals(Size other) => this == other; 190/// Creates a human-readable string that represents this <see cref='System.Drawing.Size'/>. 195/// Multiplies <see cref="Size"/> by an <see cref="int"/> producing <see cref="Size"/>. 197/// <param name="size">Multiplicand of type <see cref="Size"/>.</param> 199/// <returns>Product of type <see cref="Size"/>.</returns> 200private static Size Multiply(Size size, int multiplier) => 204/// Multiplies <see cref="Size"/> by a <see cref="float"/> producing <see cref="SizeF"/>. 206/// <param name="size">Multiplicand of type <see cref="Size"/>.</param> 209private static SizeF Multiply(Size size, float multiplier) =>
System\Drawing\SizeF.cs (2)
175public readonly Size ToSize() => Size.Truncate(this);
System.Private.Windows.Core (27)
_generated\209\Windows.Win32.RECT.g.cs (2)
44 internal RECT(global::System.Drawing.Point location, global::System.Drawing.Size size) : 72 internal readonly global::System.Drawing.Size Size => new global::System.Drawing.Size(this.Width, this.Height);
_generated\220\Windows.Win32.SIZE.g.cs (3)
33 internal SIZE(global::System.Drawing.Size value) : this(value.Width, value.Height) 51 public static implicit operator global::System.Drawing.Size(SIZE value) => new global::System.Drawing.Size(value.cx, value.cy); 53 public static implicit operator SIZE(global::System.Drawing.Size value) => new SIZE(value);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (4)
173/// Writes a <see cref="Size"/> in binary format. 175public static void WriteSize(Stream stream, Size value) 180new ClassInfo(1, typeof(Size).FullName!, s_sizeMemberNames), 740case Size size:
System\Private\Windows\Graphics\IBitmap.cs (1)
21Size Size { get; }
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (2)
94{ Types.ToTypeName($"{Types.SizeType}"), typeof(Size) }, 161|| type == typeof(Size)
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
83/// Tries to get this object as a <see cref="Size"/>. 94|| !classInfo.TypeNameMatches(typeof(Size))
System\Value.cs (9)
399public Value(Size value) 405public Value(Size? value) 418public static implicit operator Value(Size value) => new(value); 419public static explicit operator Size(in Value value) => value.GetValue<Size>(); 420public static implicit operator Value(Size? value) => new(value); 421public static explicit operator Size?(in Value value) => value.GetValue<Size?>(); 713|| (typeof(T) == typeof(Size) && _object == TypeFlags.Size)
System\Value.TypeFlags.cs (2)
28internal static StraightCastFlag<Size> Size { get; } = StraightCastFlag<Size>.Instance;
System\Value.Union.cs (1)
38[FieldOffset(0)] public Size Size;
Windows\Win32\Foundation\RECT.cs (1)
10public RECT(Size size)
System.Private.Windows.Core.TestUtilities (4)
CommonTestHelper.cs (4)
95public static TheoryData<Size> GetSizeTheoryData() => GetSizeTheoryData(TestIncludeType.All); 97public static TheoryData<Size> GetSizeTheoryData(TestIncludeType includeType) 99TheoryData<Size> data = new(); 102data.Add(default(Size));
System.Private.Windows.GdiPlus (2)
System\Drawing\IIcon.cs (1)
8Size Size { get; }
System\Drawing\IIconExtensions.cs (1)
19Size size = icon.Size;
System.Windows.Forms (1008)
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (2)
141if (GetTextExtentPoint32(ch, out Size size)) 372private unsafe bool GetTextExtentPoint32(char item, out Size size)
System\Windows\Forms\ActiveX\AxHost.cs (13)
320protected override Size DefaultSize 1071private unsafe void HiMetric2Pixel(ref Size sz) 1084private unsafe void Pixel2hiMetric(ref Size sz) 1118private unsafe Size SetExtent(int width, int height) 1120Size size = new(width, height); 1139private unsafe Size GetExtent() 1141Size size = default; 1184Size adjustedSize = ApplySizeConstraints(width, height); 1214Size p = SetExtent(width, height); 1407Size p = GetExtent(); 3245Size setExtent = Size; 3249Size ocxExtent = GetExtent(); 3260Size newSize = SetExtent(setExtent.Width, setExtent.Height);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (7)
442Size sWindowExt = default; 443Size sViewportExt = default; 692internal unsafe void GetExtent(DVASPECT dwDrawAspect, Size* pSizel) 699Size size = _control.Size; 1675internal unsafe void SetExtent(DVASPECT dwDrawAspect, Size* pSizel) 1692Size size = new(HiMetricToPixel(pSizel->Width, pSizel->Height)); 1703Size adjusted = new(size.Width, size.Height);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (4)
273ActiveXInstance.SetExtent(dwDrawAspect, (Size*)psizel); 285ActiveXInstance.GetExtent(dwDrawAspect, (Size*)psizel); 497ActiveXInstance.SetExtent(DVASPECT.DVASPECT_CONTENT, (Size*)pSizel); 509ActiveXInstance.GetExtent(DVASPECT.DVASPECT_CONTENT, (Size*)pSizel);
System\Windows\Forms\Control.cs (44)
368Size defaultSize = DefaultSize; 1268public Size ClientSize 1669protected virtual Size DefaultMaximumSize => CommonProperties.DefaultMaximumSize; 1671protected virtual Size DefaultMinimumSize => CommonProperties.DefaultMinimumSize; 1681protected virtual Size DefaultSize => Size.Empty; 2136public virtual Size GetPreferredSize(Size proposedSize) 2152Size cachedSize = CommonProperties.xGetPreferredSizeCache(this); 2161Size preferredSize; 2188internal virtual Size GetPreferredSizeCore(Size proposedSize) 2554[AmbientValue(typeof(Size), "0, 0")] 2555public virtual Size MaximumSize 2560if (value == Size.Empty) 2577public virtual Size MinimumSize 3098public Size Size 3827public Size PreferredSize 3829get { return GetPreferredSize(Size.Empty); } 5263internal Size ApplySizeConstraints(int width, int height) 5270internal Size ApplySizeConstraints(Size proposedSize) 5280if (MaximumSize != Size.Empty || MinimumSize != Size.Empty) 5282Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(MaximumSize); 6441public Size LogicalToDeviceUnits(Size value) => ScaleHelper.ScaleToDpi(value, DeviceDpi); 9802Size minSize = MinimumSize; 9803Size maxSize = MaximumSize; 9806MinimumSize = Size.Empty; 9807MaximumSize = Size.Empty; 9849Size adornmentSize = adornments.Size; 9854LayoutUtils.UnionSizes(Size.Empty, minSize), // make sure we don't go below 0. 9863LayoutUtils.UnionSizes(Size.Empty, maxSize), // make sure we don't go below 0. 9870Size maximumSize = LayoutUtils.ConvertZeroToUnbounded(maxSize); 9871Size scaledSize = LayoutUtils.IntersectSizes(rawScaledBounds.Size, maximumSize); 9928internal Size ScaleSize(Size startSize, float x, float y) 9930Size size = startSize; 10240protected virtual Size SizeFromClientSize(Size clientSize) => SizeFromClientSizeInternal(clientSize); 10242internal Size SizeFromClientSizeInternal(Size size) 10762Size s = DefaultSize;
System\Windows\Forms\Control.MetafileDCWrapper.cs (1)
28internal unsafe MetafileDCWrapper(HDC hOriginalDC, Size size)
System\Windows\Forms\Controls\Buttons\Button.cs (6)
31private Size _systemSize = new(InvalidDimensionValue, InvalidDimensionValue); 84internal override Size GetPreferredSizeCore(Size proposedConstraints) 88Size preferredSize = base.GetPreferredSizeCore(proposedConstraints); 96Size requiredSize = TextRenderer.MeasureText(Text, Font); 106Size paddedSize = _systemSize + Padding.Size;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (7)
258protected override Size DefaultSize => new(75, 23); 994public override Size GetPreferredSize(Size proposedSize) 1012internal override Size GetPreferredSizeCore(Size proposedConstraints) 1014Size preferredSize = Adapter.GetPreferredSizeCore(proposedConstraints); 1240Size preferredSize = PreferredSize;
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (4)
49internal virtual Size GetPreferredSizeCore(Size proposedSize) 592ImageSize = Size.Empty, 619ImageSize = (Control.Image is null) ? Size.Empty : Control.Image.Size,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (34)
32public Size ImageSize { get; set; } 117private Size Compose(Size checkSize, Size imageSize, Size textSize) 148private Size Decompose(Size checkSize, Size imageSize, Size proposedSize) 187internal Size GetPreferredSizeCore(Size proposedSize) 196Size bordersAndPadding = new(linearBorderAndPadding, linearBorderAndPadding); 201Size checkSize = checkSizeLinear > 0 ? new(checkSizeLinear + 1, checkSizeLinear) : Size.Empty; 204Size textImageInsetSize = new(TextImageInset * 2, TextImageInset * 2); 205Size requiredImageSize = (ImageSize != Size.Empty) ? ImageSize + textImageInsetSize : Size.Empty; 211Size textSize = Size.Empty; 232Size requiredSize = Compose(checkSize, ImageSize, textSize); 286layout.Focus = ImageSize != Size.Empty 490if (ImageSize == Size.Empty || Text is null || Text.Length == 0 || textImageRelation == TextImageRelation.Overlay) 493Size textSize = GetTextSize(maxBounds.Size); 496Size size = ImageSize; 497if (layout.Options.DotNetOneButtonCompat && ImageSize != Size.Empty) 508Size maxTextSize = LayoutUtils.SubAlignedRegion(maxBounds.Size, ImageSize, textImageRelation); 509Size textSize = GetTextSize(maxTextSize); 513Size combinedSize = LayoutUtils.AddAlignedRegion(textSize, ImageSize, textImageRelation); 659protected virtual Size GetTextSize(Size proposedSize) 663Size textSize = Size.Empty; 670textSize = Size.Ceiling(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckableControlBaseAdapter.cs (2)
22internal override Size GetPreferredSizeCore(Size proposedSize)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (2)
88internal override Size GetPreferredSizeCore(Size proposedSize)
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\FlatButtonDarkModeRenderer.cs (1)
21private static readonly Size s_corner = new(CornerRadius, CornerRadius);
System\Windows\Forms\Controls\Buttons\CheckBox.cs (5)
272protected override Size DefaultSize => new(104, 24); 289internal override Size GetPreferredSizeCore(Size proposedConstraints) 302Size textSize = TextRenderer.MeasureText(Text, Font); 303Size size = SizeFromClientSize(textSize);
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (3)
230public static Size GetGlyphSize(Graphics g, CheckBoxState state) => GetGlyphSize((IDeviceContext)g, state); 232internal static Size GetGlyphSize(IDeviceContext deviceContext, CheckBoxState state, HWND hwnd = default) 243internal static Size GetGlyphSize(HDC hdc, CheckBoxState state, HWND hwnd)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (5)
237protected override Size DefaultSize => new(104, 24); 264internal override Size GetPreferredSizeCore(Size proposedConstraints) 271Size textSize = TextRenderer.MeasureText(Text, Font); 272Size size = SizeFromClientSize(textSize);
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (2)
251public static Size GetGlyphSize(Graphics g, RadioButtonState state) 257internal static Size GetGlyphSize(HDC hdc, RadioButtonState state, HWND hwnd)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (2)
196if (GetTextExtentPoint32(ch, out Size size)) 447private unsafe bool GetTextExtentPoint32(char item, out Size size)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (8)
382protected override Size DefaultSize 665public override Size MaximumSize 671public override Size MinimumSize 779Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 790Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 821Size textExtent = Size.Empty; 841Size fixedFrameBoderSize = SystemInformation.FixedFrameBorderSize;
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (2)
229private static readonly Size s_dragSize = SystemInformation.DragSize; 2117protected override Size DefaultSize => new(240, 150);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (3)
5782Size hotDoubleClickZone = SystemInformation.DoubleClickSize; 8974internal override Size GetPreferredSizeCore(Size proposedConstraints)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (3)
276protected override Size GetPreferredSize( 280Size constraintSize) 289Size preferredSize;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (17)
414public Size PreferredSize => GetPreferredSize(RowIndex); 583public Size Size => GetSize(RowIndex); 1670internal static DataGridViewFreeDimension GetFreeDimensionFromConstraint(Size constraintSize) 2282internal Size GetPreferredSize(int rowIndex) 2291return GetPreferredSize(screen, dataGridViewCellStyle, rowIndex, Size.Empty); 2294protected virtual Size GetPreferredSize( 2298Size constraintSize) => new(-1, -1); 2317Size size = MeasureTextSize(g, text, cellStyle.Font!, flags); 2337protected virtual Size GetSize(int rowIndex) 2541Size requiredSize = TextRenderer.MeasureText(text, font, new Size(maxWidth, int.MaxValue), flags); 2547public static Size MeasureTextPreferredSize( 2568Size textOneLineSize = MeasureTextSize(graphics, text, font, flags); 2576Size textSize; 2593public static Size MeasureTextSize( 2622Size oneLineSize = MeasureTextSize(graphics, text, font, flags); 2632Size textSize; 3947internal static bool TextFitsInBounds(Graphics graphics, string text, Font font, Size maxBounds, TextFormatFlags flags)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (5)
635protected override Size GetPreferredSize( 639Size constraintSize) 652Size preferredSize; 656Size checkBoxSize = CheckBoxRenderer.GetGlyphSize(graphics, CheckBoxState.UncheckedNormal); 1158Size checkBoxSize;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (5)
476protected override Size GetPreferredSize( 480Size constraintSize) 502Size preferredSize; 556Size glyphSize; 568glyphSize = Size.Empty;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (6)
536Size size = GetSize(rowIndex); 537Size adjustedSize = new(size.Width - borderAndPaddingWidths.X - borderAndPaddingWidths.Width, 606Size preferredSize = TextRenderer.MeasureText(comboBox.GetItemText(item), comboBox.Font); 1159protected override Size GetPreferredSize( 1163Size constraintSize) 1180Size preferredSize =
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
342protected override Size GetSize(int rowIndex)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (7)
395protected override Size GetPreferredSize( 399Size constraintSize) 408Size preferredSize; 431preferredSize = Size.Empty; 443preferredSize = Size.Empty; 466preferredSize = Size.Empty; 478preferredSize = Size.Empty;
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (3)
533protected override Size GetPreferredSize( 537Size constraintSize) 546Size preferredSize;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
506protected override Size GetPreferredSize( 510Size constraintSize) 855Size maxBounds = new(valBounds.Width - s_iconsWidth - 2 * RowHeaderIconMarginWidth, valBounds.Height);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (3)
385protected override Size GetPreferredSize( 389Size constraintSize) 398Size preferredSize;
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (2)
134protected override Size GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex, Size constraintSize)
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (7)
150internal static Size GetPreferredRowHeaderSize( 158Size constraintSize, 161Size preferredSize; 322Size sizeRequired = TextRenderer.MeasureText(text, font, new Size(int.MaxValue, int.MaxValue), flags); 329Size sizeCell = new(cellBounds.Width, cellBounds.Height); 330Size sizeConstraint = TextRenderer.MeasureText(text, font, sizeCell, flags); 351Size sizeText,
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (3)
452protected override Size DefaultSize => new(200, PreferredHeight); 1018internal override Size GetPreferredSizeCore(Size proposedConstraints)
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (10)
137protected override Size DefaultSize => new(200, 100); 146Size size = ClientSize; 467Size textSize; 485textSize = Size.Ceiling(graphics.MeasureString(Text, Font, textRectangle.Width, format)); 598internal override Size GetPreferredSizeCore(Size proposedSize) 601Size borderSize = SizeFromClientSize(Size.Empty); 602Size totalPadding = borderSize + new Size(0, _fontHeight) + Padding.Size; 604Size prefSize = LayoutEngine.GetPreferredSize(this, proposedSize - totalPadding);
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (2)
181Size measuredBounds = TextRenderer.MeasureText( 284Size measuredBounds = TextRenderer.MeasureText(
System\Windows\Forms\Controls\ImageList\ImageList.cs (4)
27private static readonly Size s_defaultImageSize = new(16, 16); 36private Size _imageSize = s_defaultImageSize; 144public Size ImageSize 319Size size = bitmap.Size;
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (1)
33public NativeImageList(Size imageSize, IMAGELIST_CREATION_FLAGS flags)
System\Windows\Forms\Controls\Labels\Label.cs (17)
316protected override Size DefaultSize => new(100, AutoSize ? PreferredHeight : 23); 837Size preferredSize = (AutoSize) ? PreferredSize : new Size(saveWidth, saveHeight); 873Size pointImageSize = image.Size; 917private protected TextFormatFlags CreateTextFormatFlags(Size constrainingSize) 997private Size GetBordersAndPadding() 999Size bordersAndPadding = Padding.Size; 1019bordersAndPadding += SizeFromClientSize(Size.Empty); 1029public override Size GetPreferredSize(Size proposedSize) 1048internal override Size GetPreferredSizeCore(Size proposedConstraints) 1050Size bordersAndPadding = GetBordersAndPadding(); 1056proposedConstraints = LayoutUtils.UnionSizes(proposedConstraints, Size.Empty); 1058Size requiredSize; 1084requiredSize = Size.Ceiling(screen.Graphics.MeasureString(Text, Font, bounds, stringFormat)); 1270Size preferredSize = GetPreferredSize(new Size(clientRect.Width, clientRect.Height)); 1391Size preferredSize = PreferredSize;
System\Windows\Forms\Controls\Labels\LinkLabel.cs (5)
560Size clientSize = new(clientRectWithPadding.Width, clientRectWithPadding.Height); 562Size textSize = TextRenderer.MeasureText(text, alwaysUnderlined, clientSize, flags); 985Size preferredSize = GetPreferredSize(new Size(clientRect.Width, clientRect.Height)); 1067Size finalRectSize = focusRectangle.Size.ToSize(); 1069Size requiredSize = MeasureTextCache.GetTextSize(Text, Font, finalRectSize, CreateTextFormatFlags(finalRectSize));
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (5)
374protected override Size DefaultSize 601Size oldSize = Size; 755internal override Size GetPreferredSizeCore(Size proposedConstraints) 1305Size textSize = LayoutUtils.OldGetLargestStringSizeInCollection(Font, strings);
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (1)
104Size textSize = TextRenderer.MeasureText(subItem.Text, subItem.Font);
System\Windows\Forms\Controls\ListView\ListView.cs (7)
139private Size _tileSize = Size.Empty; 748protected override Size DefaultSize 1641public unsafe Size TileSize 1652return Size.Empty; 1703return !_tileSize.Equals(Size.Empty); 5521int textWidth = Size.Ceiling(g.MeasureString(text, Font)).Width;
System\Windows\Forms\Controls\Menus\MenuStrip.cs (1)
66protected override Size DefaultSize =>
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (14)
84private static readonly Size s_defaultSingleMonthSize = new(176, 153); 98private Size _dimensions = new(1, 1); 267public Size CalendarDimensions 322protected override Size DefaultSize => GetMinReqRect(); 791public Size SingleMonthSize 817public new Size Size 1075Size minSize = GetMinReqRect(); 1172private Size GetMinReqRect() => GetMinReqRect(0, false, false); 1180private Size GetMinReqRect(int newDimensionLength, bool updateRows, bool updateCols) 1182Size minSize = SingleMonthSize; 1185Size textExtent; 1273Size preferredSize = GetMinReqRect(height, updateRows, false); 1283Size preferredSize = GetMinReqRect(width, false, updateCols); 1651Size max = SystemInformation.MaxWindowTrackSize;
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (7)
46private Size _savedSize; 220protected override Size DefaultSize => new(100, 50); 364Size imageSize = _image.Size; 1026internal override Size GetPreferredSizeCore(Size proposedSize) 1034Size bordersAndPadding = SizeFromClientSize(Size.Empty) + Padding.Size;
System\Windows\Forms\Controls\ProgressBar\ProgressBar.cs (1)
188protected override Size DefaultSize => new(100, 23);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (7)
100private static readonly Size s_defaultLargeButtonSize = new(32, 32); 101private static readonly Size s_defaultNormalButtonSize = new(16, 16); 102private static Size s_largeButtonSize = s_defaultLargeButtonSize; 103private static Size s_normalButtonSize = s_defaultNormalButtonSize; 545protected override Size DefaultSize => new(130, 130); 2821Size size = _targetMove.Size; 4091Size size = child.Size;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.MeasureTextHelper.cs (2)
28Size.Ceiling(size), 38Size.Ceiling(size),
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.cs (1)
61Size size = ClientSize;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (3)
93Size size = Size.Ceiling(sizef); 150Size size = ClientSize;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (17)
961Size size = new(width, height); 1095var size = Size.Ceiling(sizeF); 1441Size size = _dropDownHolder.Size; 1674Size size = GetOurSize(); 1877private Size GetOurSize() 1879Size size = ClientSize; 1882Size sizeWindow = Size; 1893Size sizeScroll = ScrollBar.Size; 1905Size size = GetOurSize(); 1991Size sizeWindow = new(rect.Width, rect.Height); 3306Size sizeWindow = Size; 3325Size size = GetOurSize(); 3742Size textSize = default; 4356Size sizeBtn = ScaleHelper.IsScalingRequirementMet 4453Size size = GetOurSize(); 4858Size size = GetOurSize();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (3)
40private static readonly Size s_minDropDownSize = 297Size newSize = new(2 * DropDownHolderBorder + _currentControl.Width, 2 * DropDownHolderBorder + _currentControl.Height); 600Size size = new(2 * DropDownHolderBorder + control.Width, 2 * DropDownHolderBorder + control.Height);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (6)
350protected override Size DefaultSize => new(100, 96); 426internal override Size GetPreferredSizeCore(Size proposedConstraints) 428Size scrollBarPadding = Size.Empty; 444Size prefSize = base.GetPreferredSizeCore(proposedConstraints);
System\Windows\Forms\Controls\Splitter\Splitter.cs (2)
90protected override Size DefaultSize 668Size clientSize = parent.ClientSize;
System\Windows\Forms\Controls\TabControl\TabControl.cs (6)
24private static readonly Size s_defaultItemSize = Size.Empty; 32private Size _itemSize = s_defaultItemSize; 229protected override Size DefaultSize 503public Size ItemSize 1534Size size = Size;
System\Windows\Forms\Controls\TabControl\TabPage.cs (4)
353[DefaultValue(typeof(Size), "0, 0")] 356public override Size MaximumSize 364public override Size MinimumSize 372public new Size PreferredSize => base.PreferredSize;
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (3)
1748internal override Size GetPreferredSizeCore(Size proposedConstraints) 1750Size size;
System\Windows\Forms\Controls\TextBox\TextBox.cs (5)
392internal override Size GetPreferredSizeCore(Size proposedConstraints) 394Size scrollBarPadding = Size.Empty; 409Size prefSize = base.GetPreferredSizeCore(proposedConstraints);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (7)
483protected override Size DefaultSize 815internal override Size GetPreferredSizeCore(Size proposedConstraints) 822Size bordersAndPadding = SizeFromClientSize(Size.Empty) + Padding.Size; 851Size textSize = TextRenderer.MeasureText(Text, Font, proposedConstraints, format); 855Size preferredSize = textSize + bordersAndPadding;
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (3)
345if (GetTextExtentPoint32(ch, out Size size)) 445private unsafe bool GetTextExtentPoint32(char item, out Size size) 449size = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (4)
15private Size _cachedHDCSize = Size.Empty; 22public HDC GetCachedItemDC(HDC toolStripHDC, Size bitmapSize) 64_cachedHDCSize = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\StatusStrip.cs (4)
61protected override Size DefaultSize 212Size statusStripSize = Size; 298internal override Size GetPreferredSizeCore(Size proposedSize)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (32)
26private static Size s_onePixel = new(1, 1); 54private Size _largestDisplayedItemSize = Size.Empty; 58private Size _imageScalingSize; 233public new Size AutoScrollMargin 242public new Size AutoScrollMinSize 539protected override Size DefaultSize => ScaleHelper.IsThreadPerMonitorV2Aware 905[DefaultValue(typeof(Size), "16,16")] 908public Size ImageScalingSize 920internal virtual Size ImageScalingSizeInternal 1285protected internal virtual Size MaxItemSize 2225internal override Size GetPreferredSizeCore(Size proposedSize) 2242Size prefSize = LayoutEngine.GetPreferredSize(this, proposedSize - padding.Size); 2260internal static Size GetPreferredSizeHorizontal(IArrangedElement container, Size proposedConstraints) 2262Size maxSize = Size.Empty; 2266Size defaultSize = toolStrip.DefaultSize - toolStrip.Padding.Size; 2282Size prefItemSize = GetPreferredItemSize(item); 2323internal static Size GetPreferredSizeVertical(IArrangedElement container) 2325Size maxSize = Size.Empty; 2340Size preferredSize = GetPreferredItemSize(item); 2387private static Size GetPreferredItemSize(ToolStripItem item) 2389return item.AutoSize ? item.GetPreferredSize(Size.Empty) : item.Size; 3443Size bitmapSize = _largestDisplayedItemSize; 3519Size itemSize = item.Size; 4215internal void SetLargestItemSize(Size size) 4240Size biggestItemSize = Size.Empty; // used in determining OnPaint caching. 4460Size invalidDefaultSize = new(-1, -1);
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (3)
159public override Size GetPreferredSize(Size constrainingSize) 161Size prefSize = base.GetPreferredSize(constrainingSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (4)
105protected override Size DefaultSize => new(100, 22); 322public override Size GetPreferredSize(Size constrainingSize) 324Size preferredSize = base.GetPreferredSize(constrainingSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripContainer.cs (3)
69public new Size AutoScrollMargin 78public new Size AutoScrollMinSize 230protected override Size DefaultSize
System\Windows\Forms\Controls\ToolStrips\ToolStripContentPanel.cs (4)
68public new Size AutoScrollMargin 77public new Size AutoScrollMinSize 183public override Size MinimumSize 192public override Size MaximumSize
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (5)
142protected override Size DefaultSize 352public override Size Size 473public override Size GetPreferredSize(Size constrainingSize) 650Size size = LayoutUtils.DeflateRect(Bounds, Padding).Size;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (10)
462internal override Size ImageScalingSizeInternal 548protected internal override Size MaxItemSize 880Size size = GetSuggestedSize(); 1049internal Size GetSuggestedSize() => AutoSize ? GetPreferredSize(Size.Empty) : Size; 1459Size clientSize = ClientSize; 1460Size minSize = MinimumSize; 1461Size maxSize = MaximumSize; 1495Size minSize = MinimumSize; 1496Size maxSize = MaximumSize;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (5)
13private static readonly Size s_logicalDropDownArrowSize = new(5, 3); 14private static Size s_dropDownArrowSize = s_logicalDropDownArrowSize; 31public override Size GetPreferredSize(Size constrainingSize) 33Size preferredSize = base.GetPreferredSize(constrainingSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (22)
14private Size _maxItemSize = Size.Empty; 34private Size _defaultImageSize; 150protected internal override Size MaxItemSize 275Size maxTextSize = Size.Empty; 276Size maxImageSize = Size.Empty; 277Size maxCheckSize = _defaultImageSize; 278Size maxArrowSize = Size.Empty; 279Size maxNonMenuItemSize = Size.Empty; 288Size menuItemTextSize = menuItem.GetTextSize(); 292Size shortcutTextSize = menuItem.GetShortcutTextSize(); 307Size imageSize = Size.Empty; 318Size checkedImageSize = menuItem.CheckedImage.Size; 822Size upSize = UpScrollButton.GetPreferredSize(Size.Empty); 828Size downSize = DownScrollButton.GetPreferredSize(Size.Empty);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.ToolStripDropDownLayoutEngine.cs (3)
15internal override Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) 17Size preferredSize = base.GetPreferredSize(container, proposedConstraints);
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (5)
15private static Size s_dragSize = LayoutUtils.s_maxSize; 75public override Size GetPreferredSize(Size constrainingSize) 77Size preferredSize = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (15)
45private Size _cachedTextSize; 572content.Size = LayoutUtils.UnionSizes(Size.Empty, content.Size); 683protected virtual Size DefaultSize 1552internal Size PreferredImageSize 1558return Size.Empty; 1574? Owner?.ImageList?.ImageSize ?? Size.Empty 1575: (image is null) ? Size.Empty : image.Size; 1807public virtual Size Size 2343public virtual Size GetPreferredSize(Size constrainingSize) 2350internal Size GetTextSize() 2354return Size.Empty; 2356else if (_cachedTextSize == Size.Empty) 2818_cachedTextSize = Size.Empty; 2997_cachedTextSize = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (6)
20private static readonly Size s_invalidSize = new(int.MinValue, int.MinValue); 22private Size _lastPreferredSize = s_invalidSize; 52public Size PreferredImageSize => Owner.PreferredImageSize; 157public virtual Size GetPreferredSize(Size constrainingSize) 175return Size.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.ToolStripItemLayoutOptions.cs (4)
16private Size _cachedSize = LayoutUtils.s_invalidSize; 17private Size _cachedProposedConstraints = LayoutUtils.s_invalidSize; 20protected override Size GetTextSize(Size proposedConstraints)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.ToolStripLayoutData.cs (1)
16private Size _size;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (9)
49private Size _cachedShortcutSize = Size.Empty; 53private static readonly Size s_checkMarkBitmapSize = new(16, 16); 176_cachedShortcutSize = Size.Empty; 214protected override Size DefaultSize => ScaleHelper.IsThreadPerMonitorV2Aware 719internal Size GetShortcutTextSize() 723return Size.Empty; 729return Size.Empty; 732if (_cachedShortcutSize == Size.Empty)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (2)
163public override Size GetPreferredSize(Size constrainingSize)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (4)
93public override Size GetPreferredSize(Size constrainingSize) 134Size biggestItemSize = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflowButton.cs (3)
71public override Size GetPreferredSize(Size constrainingSize) 73Size preferredSize = constrainingSize;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (3)
44MinimumSize = Size.Empty; // consider 1,1 83public new Size AutoScrollMargin 92public new Size AutoScrollMinSize
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (5)
20private Size _maxSize = LayoutUtils.s_maxSize; 130public Size MaximumSize 265public override Size GetPreferredSize(Size constrainingSize) 268Size preferredSize;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (7)
339internal Size GetMinimumSize(ToolStrip toolStrip) 341if (toolStrip.MinimumSize == Size.Empty) 460Size minSize = GetMinimumSize((ToolStrip)currentCell.Control); 557Size minSize = GetMinimumSize((ToolStrip)currentCell.Control); 670Size IArrangedElement.GetPreferredSize(Size constrainingSize) 672Size preferredSize = LayoutEngine.GetPreferredSize(this, constrainingSize - Padding.Size) + Padding.Size;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (2)
84Size totalSize = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (2)
86Size totalSize = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (2)
21private static readonly Size s_onePix = new(1, 1); 346Rectangle bounds = new(Point.Empty, item?.Size ?? Size.Empty);
System\Windows\Forms\Controls\ToolStrips\ToolStripProgressBar.cs (1)
71protected override Size DefaultSize
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (2)
918Size textSize = LayoutUtils.FlipSize(textRect.Size); 1169Size size = normalImage.Size;
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (5)
15private static readonly Size s_defaultBitmapSize = new(16, 16); 128public override Size GetPreferredSize(Size constrainingSize) 130Size preferredSize = Size.Empty;
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (3)
54protected override Size DefaultSize => new(SeparatorThickness, SeparatorThickness); 257public override Size GetPreferredSize(Size constrainingSize)
System\Windows\Forms\Controls\ToolStrips\ToolStripSettings.cs (2)
72public Size Size 76return (Size)this[nameof(Size)];
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.SettingsStub.cs (1)
18public Size Size;
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (3)
347public override Size GetPreferredSize(Size constrainingSize) 349Size preferredSize = SplitButtonButtonLayout.GetPreferredSize(constrainingSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (14)
29private Size OverflowButtonSize 36return Size.Empty; 40Size overflowButtonSize = toolStrip.OverflowButton.AutoSize ? toolStrip.OverflowButton.GetPreferredSize(_displayRectangle.Size) : toolStrip.OverflowButton.Size; 86Size itemSize = item.AutoSize ? item.GetPreferredSize(_displayRectangle.Size) : item.Size; 136Size itemSize = item.AutoSize ? item.GetPreferredSize(_displayRectangle.Size) : item.Size; 153internal override Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) 216Size itemSize; 270itemSize = item.AutoSize ? item.GetPreferredSize(Size.Empty) : item.Size; 361Size itemSize; 365Size toolStripPreferredSize = _displayRectangle.Size; 412itemSize = item.AutoSize ? item.GetPreferredSize(Size.Empty) : item.Size; 487private void SetItemLocation(ToolStripItem item, Point itemLocation, Size itemSize) 584Size itemSize = item.AutoSize ? item.GetPreferredSize(_displayRectangle.Size) : item.Size;
System\Windows\Forms\Controls\ToolStrips\ToolStripStatusLabel.cs (2)
177public override Size GetPreferredSize(Size constrainingSize)
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.cs (3)
77protected override Size DefaultSize => new Size(100, 22); 89public override Size GetPreferredSize(Size constrainingSize)
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (1)
200protected override Size DefaultSize => new(104, PreferredDimension);
System\Windows\Forms\Controls\TrackBar\TrackBarRenderer.cs (4)
168public static Size GetLeftPointingThumbSize(Graphics g, TrackBarThumbState state) 178public static Size GetRightPointingThumbSize(Graphics g, TrackBarThumbState state) 188public static Size GetTopPointingThumbSize(Graphics g, TrackBarThumbState state) 198public static Size GetBottomPointingThumbSize(Graphics g, TrackBarThumbState state)
System\Windows\Forms\Controls\TreeView\TreeNode.cs (1)
631Size size = tv.ClientSize;
System\Windows\Forms\Controls\TreeView\TreeView.cs (6)
81private static Size? s_stateImageSize; 82private static Size? StateImageSize 413protected override Size DefaultSize => new(121, 97); 1792_internalStateImageList.ImageSize = (Size)StateImageSize; 1977newImageList.ImageSize = (Size)StateImageSize; 2815Size textSize = TextRenderer.MeasureText(node.Text, node.TreeView!.Font);
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGridBoolColumn.cs (1)
78protected internal override Size GetPreferredSize(Graphics g, object value) => throw null;
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGridColumnStyle.cs (1)
154protected internal abstract Size GetPreferredSize(Graphics g, object value);
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGridTextBoxColumn.cs (1)
79protected internal override Size GetPreferredSize(Graphics g, object value) => throw null;
System\Windows\Forms\Controls\Unsupported\ToolBar\ToolBar.cs (2)
90public Size ButtonSize 144public Size ImageSize => throw null;
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (2)
509internal override Size GetPreferredSizeCore(Size proposedConstraints)
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (3)
762internal override Size GetPreferredSizeCore(Size proposedConstraints) 846Size digitSize = TextRenderer.MeasureText(charSpan, Font);
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (5)
87public new Size AutoScrollMargin 96public new Size AutoScrollMinSize 244protected override Size DefaultSize => new(DefaultControlWidth, PreferredHeight); 281public override Size MaximumSize 287public override Size MinimumSize
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (2)
183public Size Size 389public void ResizeTo(Size size)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1125protected override Size DefaultSize => new(250, 250);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (10)
53private Size _webBrowserBaseChangingSize = Size.Empty; 781Size extent = Size; 1076private unsafe Size SetExtent(int width, int height) 1078Size sz = new(width, height); 1096private unsafe Size GetExtent() 1098Size size = default; 1104private unsafe void HiMetric2Pixel(ref Size sz) 1116private unsafe void Pixel2hiMetric(ref Size sz) 1185protected override Size DefaultSize => new(75, 23);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.WebBrowserBaseNativeWindow.cs (1)
43Size s = _webBrowserBase._webBrowserBaseChangingSize;
System\Windows\Forms\Design\ComponentEditorForm.cs (4)
19private Size _maxSize = Size.Empty; 253Size size = new(bounds.Width + 3 * (BUTTON_PAD + xFrame) + selectorWidth, 351Size pageSize = page.Size;
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (1)
95Size size = default;
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (3)
208Size textSize = new(_scaledMaxWidth - _scaledPaddingWidth, int.MaxValue); 213textSize = Size.Ceiling(TextRenderer.MeasureText(messageText, Font, textSize, TextFormatFlags.WordBreak)); 219textSize = Size.Ceiling(g.MeasureString(messageText, Font, textSize.Width));
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.cs (1)
206internal Rectangle GetIconBounds(Size size)
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
301Size size = iconRegion.Size;
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (2)
42Size size = _icon.Size; 81public Size Size => _icon.Size;
System\Windows\Forms\Form.cs (53)
149private Size _autoScaleBaseSize = Size.Empty; 150private Size _minAutoSize = Size.Empty; 166private Dictionary<int, Size>? _dpiFormSizes; 436public virtual Size AutoScaleBaseSize 498_minAutoSize = Size.Empty; 665Size size = ClientSize; 727public new Size ClientSize 882protected override Size DefaultSize => new Size(300, 300); 1183[DefaultValue(typeof(Size), "0, 0")] 1184public override Size MaximumSize 1186get => Properties.TryGetValue(s_propMaxTrackSize, out Size maximumSize) ? maximumSize : Size.Empty; 1201private void UpdateMaximumSize(Size value, bool updateFormSize = true) 1208Size minimumSize = MinimumSize; 1233Size size = Size; 1297public override Size MinimumSize 1299get => Properties.TryGetValue(s_propMinTrackSize, out Size minimumSize) ? minimumSize : DefaultMinimumSize; 1318private void UpdateMinimumSize(Size value, bool updateFormSize = true) 1325Size maximumSize = MaximumSize; 1350Size size = Size; 1905public new Size Size 3042Size baseVar = AutoScaleBaseSize; 3044Size newVar = new((int)Math.Round(newVarF.Width), (int)Math.Round(newVarF.Height)); 3076Size correctClientSize = ClientSize; 3115Size correct = ComputeWindowSize(correctClientSize); 3265private Size ComputeWindowSize(Size clientSize) 3275private Size ComputeWindowSize(Size clientSize, WINDOW_STYLE style, WINDOW_EX_STYLE exStyle) 3671Size correct = ComputeWindowSize(ClientSize, (WINDOW_STYLE)maskedStyle, (WINDOW_EX_STYLE)cp.ExStyle); 3902Size s = Size; 4250Size prefSize = PreferredSize; 4255Size adjustedSize = AutoSizeMode == AutoSizeMode.GrowAndShrink ? prefSize : LayoutUtils.UnionSizes(prefSize, Size); 4443Size size = ClientSize; 4574protected virtual bool OnGetDpiScaledSize(int deviceDpiOld, int deviceDpiNew, ref Size desiredSize) 4614Size desiredSize = default; 5078Size restoredSize = _restoredWindowBounds.Size; 5153Size clientSize = ClientSize; 5183Size minSize = MinimumSize; 5184Size maxSize = MaximumSize; 5298Size max = SystemInformation.MaxWindowTrackSize; 5318Size min = SystemInformation.MinWindowTrackSize; 6032_autoScaleBaseSize = Size.Empty; 6239Size previousClientSize = ClientSize; 6865Size minTrack = (AutoSize && _formStateEx[s_formStateExInModalSizingLoop] == 1) ? LayoutUtils.UnionSizes(_minAutoSize, MinimumSize) : MinimumSize; 6867Size maxTrack = MaximumSize; 6881private unsafe void WmGetMinMaxInfoHelper(ref Message m, Size minTrack, Size maxTrack, Rectangle maximizedBounds) 6901Size virtualScreen = SystemInformation.VirtualScreen.Size; 6917Size minTrackWindowSize = SystemInformation.MinWindowTrackSize; 7007Size clientSize = ClientSize;
System\Windows\Forms\Input\Cursor.cs (7)
22private static Size s_cursorSize = Size.Empty; 193public Size Size 224Size sz = Size; 267Size cursorSize = Size; 375private Size GetIconSize(HICON iconHandle) 419Size picSize = ScaleHelper.ScaleToDpi(GetIconSize(cursorHandle), ScaleHelper.InitialSystemDpi);
System\Windows\Forms\Layout\ArrangedElement.cs (3)
152public virtual Size GetPreferredSize(Size constrainingSize) 154Size preferredSize = LayoutEngine.GetPreferredSize(this, constrainingSize - Padding.Size) + Padding.Size;
System\Windows\Forms\Layout\CommonProperties.cs (25)
32internal static Size DefaultMinimumSize { get; } = new(0, 0); 33internal static Size DefaultMaximumSize { get; } = new(0, 0); 97internal static Size GetMaximumSize(IArrangedElement element, Size defaultMaximumSize) 99if (element.Properties.TryGetValue(s_maximumSizeProperty, out Size size)) 110internal static Size GetMinimumSize(IArrangedElement element, Size defaultMinimumSize) 112if (element.Properties.TryGetValue(s_minimumSizeProperty, out Size size)) 126/// and/or the <see cref="Control.GetPreferredSize(Size)"/> calculation of a control. 198internal static void SetMaximumSize(IArrangedElement element, Size value) 220internal static void SetMinimumSize(IArrangedElement element, Size value) 342/// <see cref="Control.GetPreferredSizeCore(Size)"/> method. DO NOT CALL DIRECTLY 348Debug.Assert(xGetPreferredSizeCache(element) == Size.Empty, "Error detected in xClearPreferredSizeCache."); 372/// <see cref="Control.GetPreferredSizeCore(Size)"/> implementation when asked for a constraining 373/// value of <see cref="LayoutUtils.s_maxSize"/> (or <see cref="Size.Empty"/> too). 375internal static Size xGetPreferredSizeCache(IArrangedElement element) 377if (element.Properties.TryGetValue(s_preferredSizeCacheProperty, out Size size) && (size != LayoutUtils.s_invalidSize)) 382return Size.Empty; 388internal static void xSetPreferredSizeCache(IArrangedElement element, Size value) 391value == Size.Empty || value != xGetPreferredSizeCache(element), 674internal static Size GetLayoutBounds(IArrangedElement element) 676if (element.Properties.TryGetValue(s_layoutBoundsProperty, out Size size)) 681return Size.Empty; 689/// The <see cref="TableLayout"/> engine now calls <see cref="SetLayoutBounds(IArrangedElement, Size)"/> when it 697internal static void SetLayoutBounds(IArrangedElement element, Size value)
System\Windows\Forms\Layout\Containers\ContainerControl.cs (6)
674internal override Size GetPreferredSizeCore(Size proposedSize) 678Size borderSize = SizeFromClientSize(Size.Empty); 679Size totalPadding = borderSize + Padding.Size; 729Size size = default;
System\Windows\Forms\Layout\Containers\SplitContainer.cs (3)
146public new Size AutoScrollMinSize 158public new Size AutoScrollMargin 324protected override Size DefaultSize
System\Windows\Forms\Layout\DefaultLayout.cs (35)
34Size proposedConstraints = LayoutUtils.s_maxSize; 46Size prefSize = element.GetPreferredSize(proposedConstraints); 59Size newSize = LayoutUtils.UnionSizes(bounds.Size, prefSize); 77private static Rectangle GetGrowthBounds(IArrangedElement element, Size newSize) 378private static Size LayoutDockedControls(IArrangedElement container, bool measureOnly) 385Size preferredSize = Size.Empty; 404Size elementSize = GetVerticalDockedSize(element, remainingBounds.Size, measureOnly); 417Size elementSize = GetVerticalDockedSize(element, remainingBounds.Size, measureOnly); 430Size elementSize = GetHorizontalDockedSize(element, remainingBounds.Size, measureOnly); 443Size elementSize = GetHorizontalDockedSize(element, remainingBounds.Size, measureOnly); 461Size elementSize = remainingBounds.Size; 488private static void TryCalculatePreferredSizeDockedControl(IArrangedElement element, Rectangle newElementBounds, bool measureOnly, ref Size preferredSize, ref Rectangle remainingBounds) 492Size neededSize = new( 514Size elementPrefSize = element.GetPreferredSize(neededSize); 541private static Size GetVerticalDockedSize(IArrangedElement element, Size remainingSize, bool measureOnly) 543Size newSize = xGetDockedSize(element, /* constraints = */ new Size(remainingSize.Width, 1)); 558private static Size GetHorizontalDockedSize(IArrangedElement element, Size remainingSize, bool measureOnly) 560Size newSize = xGetDockedSize(element, /* constraints = */ new Size(1, remainingSize.Height)); 575private static Size xGetDockedSize(IArrangedElement element, Size constraints) 577Size desiredSize; 596return TryCalculatePreferredSize(container, measureOnly: false, preferredSize: out Size _); 602private static bool TryCalculatePreferredSize(IArrangedElement container, bool measureOnly, out Size preferredSize) 639Size preferredSizeForDocking = Size.Empty; 640Size preferredSizeForAnchoring; 1110internal override Size GetPreferredSize(IArrangedElement container, Size proposedBounds) 1114TryCalculatePreferredSize(container, measureOnly: true, preferredSize: out Size prefSize); 1118private static Size GetAnchorPreferredSize(IArrangedElement container) 1120Size prefSize = Size.Empty;
System\Windows\Forms\Layout\FlowLayout.cs (14)
23internal override Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) 26Size prefSize = TryCalculatePreferredSize(container, measureBounds, measureOnly: true); 53private static Size TryCalculatePreferredSize(IArrangedElement container, Rectangle displayRect, bool measureOnly) 65Size layoutSize = Size.Empty; 77Size rowSize = MeasureRow(containerProxy, elementProxy, i, measureBounds, out int breakIndex); 137private static Size MeasureRow( 156private static Size TryCalculatePreferredSizeRow( 167Size rowSize = Size.Empty; 184Size prefSize; 187Size elementConstraints = new(int.MaxValue, rowBounds.Height - elementProxy.Margin.Size.Height); 218Size requiredSize = prefSize + elementProxy.Margin.Size;
System\Windows\Forms\Layout\FlowLayout.ElementProxy.cs (5)
69public virtual Size MinimumSize => CommonProperties.GetMinimumSize(Element!, Size.Empty); 73public virtual Size SpecifiedSize => CommonProperties.GetSpecifiedBounds(_element!).Size; 84public virtual Size GetPreferredSize(Size proposedSize) => _element!.GetPreferredSize(proposedSize);
System\Windows\Forms\Layout\FlowLayout.VerticalElementProxy.cs (4)
51public override Size MinimumSize => LayoutUtils.FlipSize(base.MinimumSize); 53public override Size SpecifiedSize => LayoutUtils.FlipSize(base.SpecifiedSize); 55public override Size GetPreferredSize(Size proposedSize)
System\Windows\Forms\Layout\IArrangedElement.cs (2)
28Size GetPreferredSize(Size proposedSize);
System\Windows\Forms\Layout\LayoutEngine.cs (3)
20internal virtual Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) 22return Size.Empty;
System\Windows\Forms\Layout\LayoutUtils.cs (45)
13public static readonly Size s_maxSize = new(int.MaxValue, int.MaxValue); 14public static readonly Size s_invalidSize = new(int.MinValue, int.MinValue); 43public static Size OldGetLargestStringSizeInCollection(Font? font, ICollection? objects) 45Size largestSize = Size.Empty; 50Size textSize = TextRenderer.MeasureText(obj.ToString(), font, new Size(short.MaxValue, short.MaxValue), TextFormatFlags.SingleLine); 124public static Size ConvertZeroToUnbounded(Size size) 205public static Size UnionSizes(Size a, Size b) 212public static Size IntersectSizes(Size a, Size b) 275public static Rectangle AlignAndStretch(Size fitThis, Rectangle withinThis, AnchorStyles anchorStyles) 280public static Rectangle Align(Size alignThis, Rectangle withinThis, AnchorStyles anchorStyles) 285public static Rectangle Align(Size alignThis, Rectangle withinThis, ContentAlignment align) 290public static Rectangle HAlign(Size alignThis, Rectangle withinThis, AnchorStyles anchorStyles) 306private static Rectangle HAlign(Size alignThis, Rectangle withinThis, ContentAlignment align) 322public static Rectangle VAlign(Size alignThis, Rectangle withinThis, AnchorStyles anchorStyles) 338public static Rectangle VAlign(Size alignThis, Rectangle withinThis, ContentAlignment align) 354public static Size Stretch(Size stretchThis, Size withinThis, AnchorStyles anchorStyles) 356Size stretchedSize = new( 390public static Size AddAlignedRegion(Size textSize, Size imageSize, TextImageRelation relation) 395public static Size AddAlignedRegionCore(Size currentSize, Size contentSize, bool vertical) 453public static Size FlipSize(Size size) 460public static Size FlipSizeIf(bool condition, Size size) 493public static bool IsZeroWidthOrHeight(Size size) 498public static bool AreWidthAndHeightLarger(Size size1, Size size2) 503public static void SplitRegion(Rectangle bounds, Size specifiedContent, AnchorStyles region1Align, out Rectangle region1, out Rectangle region2) 570public static Size SubAlignedRegion(Size currentSize, Size contentSize, TextImageRelation relation) 575public static Size SubAlignedRegionCore(Size currentSize, Size contentSize, bool vertical)
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.cs (6)
22private Size _unconstrainedPreferredSize = s_invalidSize; 29public Size GetTextSize(string? text, Font? font, Size proposedConstraints, TextFormatFlags flags) 78Size prefSize = TextRenderer.MeasureText(text, font, proposedConstraints, flags); 99public bool TextRequiresWordBreak(string? text, Font? font, Size size, TextFormatFlags flags) 108private Size GetUnconstrainedSize(string? text, Font? font, TextFormatFlags flags)
System\Windows\Forms\Layout\LayoutUtils.MeasureTextCache.PreferredSizeCache.cs (4)
12public Size ConstrainingSize; 14public Size PreferredSize; 16public PreferredSizeCache(Size constrainingSize, Size preferredSize)
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (4)
371public Size GetCachedPreferredSize(Size proposedConstraints, out bool isValid) 376Size cachedSize = CommonProperties.xGetPreferredSizeCache(Container); 385return Size.Empty;
System\Windows\Forms\Layout\TableLayout.cs (18)
105Size containerSize = container.DisplayRectangle.Size - new Size(cellBorderWidth, cellBorderWidth); 111Size usedSpace = ApplyStyles(containerInfo, containerSize, measureOnly: false); 135internal override Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) 145Size prefSize = containerInfo.GetCachedPreferredSize(proposedConstraints, out bool isCacheValid); 162Size containerSize = container.DisplayRectangle.Size - new Size(cellBorderWidth * 2, cellBorderWidth * 2); 176Size cellBorderSize = new(cellBorderWidth, cellBorderWidth); 222private static void ExpandLastElement(ContainerInfo containerInfo, Size usedSpace, Size totalSpace) 617private static Size ApplyStyles(ContainerInfo containerInfo, Size proposedConstraints, bool measureOnly) 619Size preferredSize = Size.Empty; 675private static int InflateColumns(ContainerInfo containerInfo, Size proposedConstraints, bool measureOnly) 732maxWidth = GetElementSize(element, Size.Empty).Width; 801private static int InflateRows(ContainerInfo containerInfo, Size proposedConstraints, int expandLastElementWidth, bool measureOnly) 866private static Size GetElementSize(IArrangedElement element, Size proposedConstraints) =>
System\Windows\Forms\Panels\Panel.cs (6)
145protected override Size DefaultSize => new(200, 100); 147internal override Size GetPreferredSizeCore(Size proposedSize) 151Size borderSize = SizeFromClientSize(Size.Empty); 152Size totalPadding = borderSize + Padding.Size;
System\Windows\Forms\Panels\SplitterPanel.cs (4)
161public new Size MinimumSize 173public new Size MaximumSize 221public new Size Size 223get => Collapsed ? Size.Empty : base.Size;
System\Windows\Forms\Printing\PrintPreviewControl.cs (16)
34private Size _virtualSize = new(1, 1); 47private Size _imageSize = Size.Empty; 387private Size VirtualSize 481Size pageSize = _pageInfo[StartPage].PhysicalSize; 482Size controlPhysicalSize = PixelsToPhysical(Size, _screenDPI); 556SetVirtualSizeNoInvalidate(Size.Empty); 622Size controlPhysicalSize = PixelsToPhysical(rect.Size, _screenDPI); 651Size pageSize = pages[imageIndex].PhysicalSize; 662Size imagePixels = PhysicalToPixels(_imageSize, _screenDPI); 751private static Size PixelsToPhysical(Size pixels, Point dpi) => 757private static Size PhysicalToPixels(Size physical, Point dpi) => 770internal void SetVirtualSizeNoInvalidate(Size value) 852(bool horizontal, bool vertical) IsScrollNeeded(Size displaySize)
System\Windows\Forms\Printing\PrintPreviewDialog.cs (7)
210public new Size MaximumSize 251public new Size MinimumSize 283public new Size Size 381protected override Size DefaultMinimumSize => new(375, 250); 499public new Size AutoScrollMargin 507public new Size AutoScrollMinSize 668public override Size AutoScaleBaseSize
System\Windows\Forms\Rendering\ControlPaint.cs (8)
51private static Size s_gridSize; // the dimensions of the grid dots 98internal static Rectangle CalculateBackgroundImageRectangle(Rectangle bounds, Size imageSize, ImageLayout imageLayout) 178Size size = bitmap.Size; 273Size size = bitmap.Size; 332Size size = bitmap.Size; 1069Size sz = SystemInformation.Border3DSize; 1538public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor) 1630Size imageSize = image.Size;
System\Windows\Forms\Rendering\ControlPaint_ModernControlButtonRenderer.cs (2)
100Size radius = new(4, 4); 116Size radius = new(4, 4);
System\Windows\Forms\Rendering\TextExtensions.cs (6)
210public static unsafe Size MeasureText( 214Size proposedSize, 221return Size.Empty; 282public static unsafe Size GetTextExtent(this HDC hdc, string? text, HFONT hfont) 286return Size.Empty; 289Size size = default;
System\Windows\Forms\Rendering\TextRenderer.cs (38)
23internal static Size MaxSize { get; } = new(int.MaxValue, int.MaxValue); 381public static Size MeasureText(string? text, Font? font) 390/// The <see cref="Size"/>, in pixels, of text drawn on a single line with the specified font. You can 399/// <see cref="MeasureText(IDeviceContext, string?, Font?, Size, TextFormatFlags)"/>. 401public static Size MeasureText(ReadOnlySpan<char> text, Font? font) 404public static Size MeasureText(string? text, Font? font, Size proposedSize) 413/// <param name="proposedSize">The <see cref="Size"/> of the initial bounding rectangle.</param> 415/// The <see cref="Size"/>, in pixels, of <paramref name="text"/> drawn with the specified 418public static Size MeasureText(ReadOnlySpan<char> text, Font? font, Size proposedSize) 421public static Size MeasureText(string? text, Font? font, Size proposedSize, TextFormatFlags flags) 430/// <param name="proposedSize">The <see cref="Size"/> of the initial bounding rectangle.</param> 433/// The <see cref="Size"/>, in pixels, of <paramref name="text"/> drawn with the specified 439public static Size MeasureText(ReadOnlySpan<char> text, Font? font, Size proposedSize, TextFormatFlags flags) 442public static Size MeasureText(IDeviceContext dc, string? text, Font? font) 452/// The <see cref="Size"/>, in pixels, of <paramref name="text"/> drawn with the specified 456public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text, Font? font) 459public static Size MeasureText(IDeviceContext dc, string? text, Font? font, Size proposedSize) 469/// <param name="proposedSize">The <see cref="Size"/> of the initial bounding rectangle.</param> 471/// The <see cref="Size"/>, in pixels, of <paramref name="text"/> drawn with the specified 475public static Size MeasureText(IDeviceContext dc, ReadOnlySpan<char> text, Font? font, Size proposedSize) 478public static Size MeasureText( 482Size proposedSize, 493/// <param name="proposedSize">The <see cref="Size"/> of the initial bounding rectangle.</param> 496/// The <see cref="Size"/>, in pixels, of <paramref name="text"/> drawn with the specified 503public static Size MeasureText( 507Size proposedSize, 511private static Size MeasureTextInternal( 514Size proposedSize, 518return Size.Empty; 526private static Size MeasureTextInternal( 530Size proposedSize, 536return Size.Empty;
System\Windows\Forms\Scrolling\HScrollBar.cs (1)
23protected override Size DefaultSize
System\Windows\Forms\Scrolling\ScrollableControl.cs (13)
22private Size _userAutoScrollMinSize = Size.Empty; 32private Size _scrollMargin = Size.Empty; 37private Size _requestedScrollMargin = Size.Empty; 94public Size AutoScrollMargin 135public Size AutoScrollMinSize 378Size layoutBounds = CommonProperties.GetLayoutBounds(this); 927private void ResetAutoScrollMargin() => AutoScrollMargin = Size.Empty; 929private void ResetAutoScrollMinSize() => AutoScrollMinSize = Size.Empty; 1123private bool ShouldSerializeAutoScrollMargin() => !AutoScrollMargin.Equals(Size.Empty); 1129private bool ShouldSerializeAutoScrollMinSize() => !AutoScrollMinSize.Equals(Size.Empty);
System\Windows\Forms\Scrolling\ScrollBarRenderer.cs (2)
127public static Size GetThumbGripSize(Graphics g, ScrollBarState state) 137public static Size GetSizeBoxSize(Graphics g, ScrollBarState state)
System\Windows\Forms\Scrolling\VScrollBar.cs (1)
27protected override Size DefaultSize
System\Windows\Forms\SystemInformation.cs (32)
57public static Size PrimaryMonitorSize => GetSize(SM_CXSCREEN, SM_CYSCREEN); 93public static Size BorderSize => GetSize(SM_CXBORDER, SM_CYBORDER); 98public static Size GetBorderSizeForDpi(int dpi) 109public static Size FixedFrameBorderSize => GetSize(SM_CXFIXEDFRAME, SM_CYFIXEDFRAME); 124public static Size IconSize => GetSize(SM_CXICON, SM_CYICON); 129public static Size CursorSize => GetSize(SM_CXCURSOR, SM_CYCURSOR); 241public static Size MinimumWindowSize => GetSize(SM_CXMIN, SM_CYMIN); 246public static Size CaptionButtonSize => GetSize(SM_CXSIZE, SM_CYSIZE); 251public static Size FrameBorderSize => GetSize(SM_CXFRAME, SM_CYFRAME); 256public static Size MinWindowTrackSize => GetSize(SM_CXMINTRACK, SM_CYMINTRACK); 263public static Size DoubleClickSize => GetSize(SM_CXDOUBLECLK, SM_CYDOUBLECLK); 273public static Size IconSpacingSize => GetSize(SM_CXICONSPACING, SM_CYICONSPACING); 305public static Size Border3DSize => GetSize(SM_CXEDGE, SM_CYEDGE); 310public static Size MinimizedWindowSpacingSize => GetSize(SM_CXMINSPACING, SM_CYMINSPACING); 315public static Size SmallIconSize => GetSize(SM_CXSMICON, SM_CYSMICON); 325public static Size ToolWindowCaptionButtonSize => GetSize(SM_CXSMSIZE, SM_CYSMSIZE); 330public static Size MenuButtonSize => GetSize(SM_CXMENUSIZE, SM_CYMENUSIZE); 366public static Size MinimizedWindowSize => GetSize(SM_CXMINIMIZED, SM_CYMINIMIZED); 372public static Size MaxWindowTrackSize => GetSize(SM_CXMAXTRACK, SM_CYMAXTRACK); 378public static Size PrimaryMonitorMaximizedWindowSize => GetSize(SM_CXMAXIMIZED, SM_CYMAXIMIZED); 396public static Size DragSize => GetSize(SM_CXDRAG, SM_CYDRAG); 408public static Size MenuCheckSize => GetSize(SM_CXMENUCHECK, SM_CYMENUCHECK); 461Size size = PrimaryMonitorSize; 591/// Gets the <see cref="Size"/> in pixels of the rectangle within which the mouse 594public static Size MouseHoverSize 761/// The <see cref="Size"/>, in pixels, of the small caption buttons. 763public static unsafe Size SmallCaptionButtonSize 771: Size.Empty; 776/// The <see cref="Size"/>, in pixels, of the menu bar buttons. 778public static unsafe Size MenuBarButtonSize 786: Size.Empty; 814private static Size GetSize(SYSTEM_METRICS_INDEX x, SYSTEM_METRICS_INDEX y)
System\Windows\Forms\ToolTip\PopupEventArgs.cs (2)
17public PopupEventArgs(IWin32Window? associatedWindow, Control? associatedControl, bool isBalloon, Size size) 38public Size ToolTipSize { get; set; }
System\Windows\Forms\ToolTip\ToolTip.cs (5)
1493if (TryGetBubbleSize(ownerWindow, out Size bubbleSize)) 1522private bool TryGetBubbleSize(IWin32Window ownerWindow, out Size bubbleSize) 1538bubbleSize = Size.Empty; 1921private void Reposition(Point tipPosition, Size tipSize) 2039Size currentTooltipSize = rect.Size;
System\Windows\Forms\UserControl.cs (1)
180protected override Size DefaultSize
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (3)
571public Size GetPartSize(IDeviceContext dc, ThemeSizeType type) 579internal unsafe Size GetPartSize(HDC dc, ThemeSizeType type, HWND hwnd = default) 598public unsafe Size GetPartSize(IDeviceContext dc, Rectangle bounds, ThemeSizeType type)
System.Windows.Forms.Design (212)
Resources\MaskDesignerDialog.Designer.cs (24)
96internal static System.Drawing.Size btnCancel_Size { 99return ((System.Drawing.Size)(obj)); 155internal static System.Drawing.Size btnOK_Size { 158return ((System.Drawing.Size)(obj)); 214internal static System.Drawing.Size checkBoxUseValidatingType_Size { 217return ((System.Drawing.Size)(obj)); 283internal static System.Drawing.Size lblHeader_Size { 286return ((System.Drawing.Size)(obj)); 343internal static System.Drawing.Size lblMask_Size { 346return ((System.Drawing.Size)(obj)); 402internal static System.Drawing.Size lblTryIt_Size { 405return ((System.Drawing.Size)(obj)); 488internal static System.Drawing.Size listViewCannedMasks_Size { 491return ((System.Drawing.Size)(obj)); 538internal static System.Drawing.Size maskedTextBox_Size { 541return ((System.Drawing.Size)(obj)); 626internal static System.Drawing.Size maskTryItTable_Size { 629return ((System.Drawing.Size)(obj)); 710internal static System.Drawing.Size okCancelTableLayoutPanel_Size { 713return ((System.Drawing.Size)(obj)); 787internal static System.Drawing.Size overarchingTableLayoutPanel_Size { 790return ((System.Drawing.Size)(obj)); 827internal static System.Drawing.Size txtBoxMask_Size { 830return ((System.Drawing.Size)(obj));
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (3)
59public override Size GetPreferredSize(Size proposedSize) 61Size preferredSize = base.GetPreferredSize(proposedSize);
System\ComponentModel\Design\DesignerActionPanel.CheckBoxPropertyLine.cs (2)
34public override Size LayoutControls(int top, int width, bool measureOnly) 36Size checkBoxPreferredSize = _checkBox.GetPreferredSize(new Size(int.MaxValue, int.MaxValue));
System\ComponentModel\Design\DesignerActionPanel.cs (7)
232public static Point ComputePreferredDesktopLocation(Rectangle rectangleAnchor, Size sizePanel, out DockStyle edgeToDock) 358private Size DoLayout(Size proposedSize, bool measureOnly) 363return Size.Empty; 380Size size = line.LayoutControls(yPos, proposedSize.Width, measureOnly); 394public override Size GetPreferredSize(Size proposedSize)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (5)
93Size textSize = default; 167public override Size LayoutControls(int top, int width, bool measureOnly) 169Size size = base.LayoutControls(top, width, measureOnly); 342Size dropDownSize = _dropDownHolder.Size; 366Size dropDownSize = _dropDownHolder.Size;
System\ComponentModel\Design\DesignerActionPanel.Line.cs (1)
43public abstract Size LayoutControls(int top, int width, bool measureOnly);
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (2)
43public override Size LayoutControls(int top, int width, bool measureOnly) 45Size linkLabelSize = _linkLabel.GetPreferredSize(new Size(int.MaxValue, int.MaxValue));
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (4)
54public override Size LayoutControls(int top, int width, bool measureOnly) 56Size titleSize = _titleLabel.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)); 57Size subtitleSize = Size.Empty;
System\ComponentModel\Design\DesignerActionPanel.SeparatorLine.cs (1)
24public override Size LayoutControls(int top, int width, bool measureOnly) => new(MinimumWidth, 1);
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (3)
19private Size _editRegionSize; 69protected Size EditRegionSize => _editRegionSize; 90public override Size LayoutControls(int top, int width, bool measureOnly)
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (2)
38public override Size LayoutControls(int top, int width, bool measureOnly) 40Size labelSize = _label.GetPreferredSize(new Size(int.MaxValue, int.MaxValue));
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (1)
35Size panelSize = CurrentPanel.GetPreferredSize(new Size(150, int.MaxValue));
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (12)
21private Size _watermarkSize = Size.Empty; 128_minimumSize = Size.Empty; 129_watermarkSize = Size.Empty; 155Size requestedSize = ContentSize; 176private unsafe Size ContentSize 231private Size _minimumSize = Size.Empty; 233public override Size MinimumSize 237if (_minimumSize == Size.Empty) 352private Size WatermarkSize 356if (_watermarkSize == Size.Empty)
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
86Size size = _pal.Size;
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (1)
179Size delta = new(Math.Abs(mouseLoc.X - InitialDragPoint.X), Math.Abs(mouseLoc.Y - InitialDragPoint.Y));
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (4)
62private Size _parentGridSize; // used to snap around to grid dots if layoutmode == SnapToGrid 110_parentGridSize = Size.Empty; 868_parentGridSize = Size.Empty; 880_parentGridSize = (Size)gridProp.GetValue(parentControl);
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (2)
40private Size _parentGridSize; // used to snap resize ops to the grid 273_parentGridSize = (Size)gridProp.GetValue(control.Parent);
System\Windows\Forms\Design\CommandSet.cs (44)
584private static Size GetSize(IComponent comp) 587return prop is not null ? (Size)prop.GetValue(comp)! : Size.Empty; 593protected virtual void GetSnapInformation(IDesignerHost host, IComponent component, out Size snapSize, out IComponent snapComponent, out PropertyDescriptor? snapProperty) 607if (gridSizeProp is not null && gridSizeProp.PropertyType != typeof(Size)) 617snapSize = gridSizeProp is not null ? (Size)gridSizeProp.GetValue(snapComponent)! : Size.Empty; 839GetSnapInformation(host, comp, out Size snapSize, out IComponent snapComponent, out PropertyDescriptor? snapProperty); 964Size primarySize = GetSize(primarySelection!); 1030Size size = (Size)sizeProp.GetValue(comp)!; 1111Size gridSize = Size.Empty; 1139gridSize = (Size)prop.GetValue(baseComponent)!; 1289Size size = (Size)sizeProp.GetValue(comp)!; 2291Size primarySize = Size.Empty; 2301primarySize = (Size)sizeProp.GetValue(component)!; 2338Size itemSize = (Size)sizeProp.GetValue(obj)!; 2390Size grid = Size.Empty; 2402grid = (Size)prop.GetValue(baseComponent)!; 2422Size size = (Size)sizeProp.GetValue(comp)!; 2524Size grid = Size.Empty; 2539grid = (Size)prop.GetValue(baseComponent)!; 2552Size curSize = Size.Empty, lastSize = Size.Empty; 2593curSize = Size.Empty; 2602curSize = (Size)curSizeDesc.GetValue(component)!; 2617curSize = Size.Empty; 2644curSize = (Size)curSizeDesc.GetValue(curComp)!; 2683lastSize = (Size)curSizeDesc.GetValue(curComp)!; 2754curSize = (Size)curSizeDesc.GetValue(curComp)!; 2785lastSize = (Size)lastSizeDesc.GetValue(lastComp)!; 3245Size size = c.Size; 3284Size parentSize = parentControl.ClientSize; 3285Size gridSize = Size.Empty; 3344gridSize = (Size)gs.GetValue(baseComponent)!;
System\Windows\Forms\Design\ComponentTray.cs (12)
30private Size _grabHandle = Size.Empty; // Size of the grab handles. 1697internal Size ParentGridSize 1972Size sz = Size.Ceiling(gr.MeasureString(Text, Font)); 2171Size minDrag = SystemInformation.DragSize; 2172Size minDblClick = SystemInformation.DoubleClickSize; 2403Size parentGridSize = _tray.ParentGridSize; 2438Size sz = _toolboxBitmap.Size; 2782private Size _snapSize = Size.Empty; 2839protected override Size GetCurrentSnapSize()
System\Windows\Forms\Design\ControlCommandSet.cs (9)
364protected override void GetSnapInformation(IDesignerHost host, IComponent component, out Size snapSize, out IComponent snapComponent, out PropertyDescriptor snapProperty) 415if (gridSizeProp is not null && gridSizeProp.PropertyType != typeof(Size)) 428snapSize = (Size)gridSizeProp.GetValue(snapComponent); 432snapSize = Size.Empty; 640Size primaryControlsize = primaryControl.Size; 680Size snapSize = Size.Empty; 785Size size = (Size)propSize.GetValue(component);
System\Windows\Forms\Design\ControlDesigner.cs (4)
1393Size minDrag = SystemInformation.DragSize; 1394Size minDblClick = SystemInformation.DoubleClickSize; 2255Size glyphSize = SystemInformation.IconSize; 2352Size dblClick = SystemInformation.DoubleClickSize;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1001int textWidth = Size.Ceiling(e.Graphics.MeasureString(columnName, e.Font!, new SizeF(bounds.Width, bounds.Height))).Width;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (1)
50width = Math.Max(width, Size.Ceiling(g.MeasureString(item.ToString(), _typesListBox.Font)).Width);
System\Windows\Forms\Design\DesignBindingPicker.cs (2)
125private Size _initialSize; 1934Size scaledSize = ScaleHelper.ScaleToDpi(imageList.ImageSize, dpi);
System\Windows\Forms\Design\DesignerFrame.cs (1)
161Size selectionSize = DesignerUtils.GetAdornmentDimensions(AdornmentType.Maximum);
System\Windows\Forms\Design\DesignerOptions.cs (2)
16private Size _gridSize = new(8, 8); 24public virtual Size GridSize
System\Windows\Forms\Design\DesignerToolStripControlHost.cs (1)
30protected override Size DefaultSize
System\Windows\Forms\Design\DesignerUtils.cs (8)
20private static Size s_minDragSize = Size.Empty; 138public static Size MinDragSize 142if (s_minDragSize == Size.Empty) 144Size minDrag = SystemInformation.DragSize; 145Size minDblClick = SystemInformation.DoubleClickSize; 188private static void DrawDragBorder(Graphics g, Size imageSize, int borderSize, Color backColor) 341public static Size GetAdornmentDimensions(AdornmentType adornmentType) => adornmentType switch
System\Windows\Forms\Design\DockEditor.DockUI.cs (1)
197Size scaledButtonSize = ScaleHelper.ScaleToDpi(new Size(LogicalButtonSize, LogicalButtonSize), dpi);
System\Windows\Forms\Design\FormDocumentDesigner.cs (7)
21private Size _autoScaleBaseSize = Size.Empty; 59private Size AutoScaleBaseSize 96private Size ClientSize 106Size size = new(-1, -1); 230private Size Size 269Size newVar = new((int)Math.Round(newVarF.Width), (int)Math.Round(newVarF.Height));
System\Windows\Forms\Design\ImageListActionList.cs (1)
34public Size ImageSize
System\Windows\Forms\Design\ImageListDesigner.cs (1)
57private Size ImageSize
System\Windows\Forms\Design\ImageListImage.cs (1)
46public Size Size => Image.Size;
System\Windows\Forms\Design\InheritanceUI.cs (1)
36Size size = InheritanceGlyph.Size;
System\Windows\Forms\Design\ISelectionUIService.cs (1)
72Size GetAdornmentDimensions(AdornmentType adornmentType);
System\Windows\Forms\Design\ParentControlDesigner.cs (23)
50private Size _gridSize = Size.Empty; 105private Size CurrentGridSize => GridSize; 207internal Size ParentGridSize => GridSize; 212protected Size GridSize 231if (value is Size size) 435Size size = Size.Empty; 436Size offset = new(0, 0); 443size = (Size)defaultValues["Size"]; 446offset = (Size)defaultValues["Offset"]; 728private void GridSizeOfParentChanged(Size gridSize) 935private static Size GetDefaultSize(IComponent component) 940Size size; 951size = (Size)prop.GetValue(component); 952if (size != Size.Empty) 966size = (Size)prop.GetValue(component); 974return ((Size)sizeAttr.Value); 1138Size gridSize = GridSize; 1238Rectangle bounds = new((Point)defaultValues["Location"], (Size)defaultValues["Size"]); 1855Size minControlSize = new(DesignerUtils.MinDragSize.Width * 2, DesignerUtils.MinDragSize.Height * 2); 2107properties["GridSize"] = TypeDescriptor.CreateProperty(typeof(ParentControlDesigner), "GridSize", typeof(Size), 2115properties["CurrentGridSize"] = TypeDescriptor.CreateProperty(typeof(ParentControlDesigner), "CurrentGridSize", typeof(Size),
System\Windows\Forms\Design\SelectionUIHandler.cs (5)
146protected abstract Size GetCurrentSnapSize(); 279Size minSize; 454Size size = new(Math.Max(MinControlWidth, newBounds.Width), Math.Max(MinControlHeight, newBounds.Height)); 596Size sz; 601sz = (Size)sizeProp.GetValue(control)!;
System\Windows\Forms\Design\SelectionUIService.cs (2)
623Size minDragSize = SystemInformation.DragSize; 1191Size ISelectionUIService.GetAdornmentDimensions(AdornmentType adornmentType) => adornmentType switch
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (2)
231Size resetButtonSize = (Size)resources.GetObject("btnReset.Size")!;
System\Windows\Forms\Design\TabOrder.cs (2)
253var sz = Size.Ceiling(graphics.MeasureString(str, font));
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
960Size dragSize = new(1, 1);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
1631public override Size GetPreferredSize(Size proposedSize)
System\Windows\Forms\Design\UserControlDocumentDesigner.cs (1)
26private Size Size
System\Windows\Forms\Design\VsPropertyGrid.cs (1)
10private static readonly Size s_defaultIconSize = new(16, 16);
System.Windows.Forms.Primitives (19)
System\Windows\Forms\Internals\ScaleHelper.cs (15)
31private static Size? s_logicalSmallSystemIconSize; 127/// <inheritdoc cref="ScaleToSize(Bitmap, Size, bool, bool)"/> 128internal static Bitmap CopyAndScaleToSize(Bitmap bitmap, Size desiredSize) 140private static Bitmap ScaleToSize(Bitmap bitmap, Size desiredSize, bool disposeBitmap = false, bool alwaysCopy = false) 142Size originalSize = bitmap.Size; 298/// Scales a logical (100%) <see cref="Size"/> value to the specified DPI. 300/// <param name="logicalSize"><see cref="Size"/> in logical units (pixels at 100%).</param> 301internal static Size ScaleToDpi(Size logicalSize, int dpi) => dpi == OneHundredPercentLogicalDpi 305internal static Size SystemIconSize => new( 309internal static Size LogicalSmallSystemIconSize => s_logicalSmallSystemIconSize ??= OsVersion.IsWindows10_1607OrGreater() 319GetIconResourceAsBestMatchBitmap(type, resource, Size.Empty); 330internal static Bitmap GetIconResourceAsBitmap(Type type, string resource, Size size) 346internal static Bitmap GetIconResourceAsBestMatchBitmap(Stream resourceStream, Size size) 357internal static Bitmap GetIconResourceAsBestMatchBitmap(Type type, string resource, Size size)
System\Windows\Forms\Padding.cs (3)
128public readonly Size Size => new(Horizontal, Vertical); 151/// Contracts a <see cref="Drawing.Size"/> by another <see cref="Drawing.Size"/>.
Windows\Win32\PInvoke.GetTextExtentPoint32.cs (1)
11public static unsafe BOOL GetTextExtentPoint32W<T>(T hdc, string lpString, int c, Size size) where T : IHandle<HDC>
WindowsFormsIntegration (27)
System\Windows\Integration\Convert.cs (5)
234internal static Size ToSystemWindowsSize(SD.Size size, Vector scale) 245internal static Size ToSystemWindowsSize(SD.Size size, Vector scale, double dpiScaleX, double dpiScaleY) 256internal static SD.Size ToSystemDrawingSize(Size size, Vector scale) 264internal static SD.Size ToSystemDrawingSize(Size size, Vector scale, double dpiScaleX, double dpiScaleY) 288internal static SD.Size ConstraintToSystemDrawingSize(Size size, Vector scale, double dpiScaleX, double dpiScaleY)
System\Windows\Integration\ElementHost.cs (6)
92public override SD.Size GetPreferredSize(SD.Size proposedSize) 113SD.Size prefSize = Convert.ToSystemDrawingSize(_decorator.DesiredSize, scale); 126protected override System.Drawing.Size DefaultSize 313SD.Size maxElementSize = Convert.ToSystemDrawingSize(new Size(childFrameworkElement.MaxWidth, childFrameworkElement.MaxHeight), scale); 314SD.Size priorMaxSize = HostUtils.ConvertZeroToUnbounded(MaximumSize);
System\Windows\Integration\HostUtils.cs (12)
41public static SD.Size ConvertZeroToUnbounded(SD.Size size) 49public static SD.Size ConvertZeroOrOneToUnbounded(SD.Size size) 56public static SD.Size ConvertUnboundedToZero(SD.Size size) 69public static SD.Size UnionSizes(SD.Size size1, SD.Size size2) 76public static SD.Size IntersectSizes(SD.Size size1, SD.Size size2)
System\Windows\Integration\WindowsFormsHost.cs (4)
243SD.Size constraintSize = Convert.ConstraintToSystemDrawingSize(constraint, _currentScale, dpi.DpiScaleX, dpi.DpiScaleY); 244SD.Size preferredSize = Child.GetPreferredSize(constraintSize); 276SD.Size targetSize = Convert.ConstraintToSystemDrawingSize(finalSize, _currentScale, dpi.DpiScaleX, dpi.DpiScaleY); 790this.Size = SD.Size.Empty;