Implemented interface member:
method
GetPreferredSize
System.Windows.Forms.Layout.IArrangedElement.GetPreferredSize(System.Drawing.Size)
6 overrides of GetPreferredSize
System.Windows.Forms (3)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
940public override Size GetPreferredSize(Size proposedSize)
System\Windows\Forms\Controls\Labels\Label.cs (1)
1031public override Size GetPreferredSize(Size proposedSize)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
93public override Size GetPreferredSize(Size constrainingSize)
System.Windows.Forms.Design (2)
System\ComponentModel\Design\DesignerActionPanel.cs (1)
394public override Size GetPreferredSize(Size proposedSize)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1679public override Size GetPreferredSize(Size proposedSize)
WindowsFormsIntegration (1)
System\Windows\Integration\ElementHost.cs (1)
96public override SD.Size GetPreferredSize(SD.Size proposedSize)
45 references to GetPreferredSize
System.Windows.Forms (10)
System\Windows\Forms\Control.cs (1)
3741get { return GetPreferredSize(Size.Empty); }
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
955return base.GetPreferredSize(proposedSize);
System\Windows\Forms\Controls\Labels\Label.cs (1)
1044return base.GetPreferredSize(proposedSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
476? _control.GetPreferredSize(constrainingSize - Padding.Size) + Padding.Size
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
1055internal Size GetSuggestedSize() => AutoSize ? GetPreferredSize(Size.Empty) : Size;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
96return base.GetPreferredSize(constrainingSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (3)
273preferredSize = _wrappedToolStrip.GetPreferredSize(constrainingSize); 279preferredSize = _wrappedToolStrip.GetPreferredSize(constrainingSize); 285preferredSize = (!_wrappedToolStrip.AutoSize) ? _wrappedToolStrip.Size : _wrappedToolStrip.GetPreferredSize(constrainingSize);
System\Windows\Forms\Layout\CommonProperties.cs (1)
126/// and/or the <see cref="Control.GetPreferredSize(Size)"/> calculation of a control.
System.Windows.Forms.Design (1)
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
94int textBoxPreferredHeight = _textBox.GetPreferredSize(new Size(int.MaxValue, int.MaxValue)).Height;
System.Windows.Forms.Tests (32)
System\Windows\Forms\ControlTests.Methods.cs (6)
2361Assert.Equal(Size.Empty, control.GetPreferredSize(proposedSize)); 2365Assert.Equal(Size.Empty, control.GetPreferredSize(proposedSize)); 2377Assert.Equal(new Size(30, 40), control.GetPreferredSize(proposedSize)); 2381Assert.Equal(new Size(30, 40), control.GetPreferredSize(proposedSize)); 2417Assert.Equal(expected, control.GetPreferredSize(proposedSize)); 2421Assert.Equal(expected, control.GetPreferredSize(proposedSize));
System\Windows\Forms\ListBoxTests.cs (8)
4806Assert.Equal(new Size(120, 96), control.GetPreferredSize(proposedSize)); 4810Assert.Equal(new Size(120, 96), control.GetPreferredSize(proposedSize)); 4823Assert.Equal(new Size(120, 96), control.GetPreferredSize(proposedSize)); 4827Assert.Equal(new Size(120, 96), control.GetPreferredSize(proposedSize)); 4847Size result = control.GetPreferredSize(proposedSize); 4856Assert.Equal(result, control.GetPreferredSize(proposedSize)); 4880Size result = control.GetPreferredSize(proposedSize); 4889Assert.Equal(result, control.GetPreferredSize(proposedSize));
System\Windows\Forms\UpDownBaseTests.cs (6)
1593Size preferredSize = control.GetPreferredSize(proposedSize); 1597preferredSize = control.GetPreferredSize(proposedSize); 1614Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.GetPreferredSize(proposedSize)); 1618Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.GetPreferredSize(proposedSize)); 1657Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.GetPreferredSize(proposedSize)); 1661Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.GetPreferredSize(proposedSize));
TextBoxBaseTests.cs (12)
5027Assert.Equal(expected, control.GetPreferredSize(proposedSize)); 5031Assert.Equal(expected, control.GetPreferredSize(proposedSize)); 5047Assert.Equal(expected + padding.Size, control.GetPreferredSize(proposedSize)); 5051Assert.Equal(expected + padding.Size, control.GetPreferredSize(proposedSize)); 5087Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.GetPreferredSize(proposedSize)); 5091Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.GetPreferredSize(proposedSize)); 5107Size result = control.GetPreferredSize(proposedSize); 5113result = control.GetPreferredSize(proposedSize); 5130Size result = control.GetPreferredSize(proposedSize); 5131Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.GetPreferredSize(proposedSize)); 5135result = control.GetPreferredSize(proposedSize); 5136Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.GetPreferredSize(proposedSize));
WindowsFormsIntegration (2)
System\Windows\Integration\ElementHost.cs (1)
100return base.GetPreferredSize(proposedSize);
System\Windows\Integration\WindowsFormsHost.cs (1)
250SD.Size preferredSize = Child.GetPreferredSize(constraintSize);