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)
940
public override Size
GetPreferredSize
(Size proposedSize)
System\Windows\Forms\Controls\Labels\Label.cs (1)
1031
public override Size
GetPreferredSize
(Size proposedSize)
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
93
public override Size
GetPreferredSize
(Size constrainingSize)
System.Windows.Forms.Design (2)
System\ComponentModel\Design\DesignerActionPanel.cs (1)
394
public override Size
GetPreferredSize
(Size proposedSize)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1679
public override Size
GetPreferredSize
(Size proposedSize)
WindowsFormsIntegration (1)
System\Windows\Integration\ElementHost.cs (1)
93
public override SD.Size
GetPreferredSize
(SD.Size proposedSize)
45 references to GetPreferredSize
System.Windows.Forms (10)
System\Windows\Forms\Control.cs (1)
3742
get { return
GetPreferredSize
(Size.Empty); }
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
955
return base.
GetPreferredSize
(proposedSize);
System\Windows\Forms\Controls\Labels\Label.cs (1)
1044
return 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)
1052
internal Size GetSuggestedSize() => AutoSize ?
GetPreferredSize
(Size.Empty) : Size;
System\Windows\Forms\Controls\ToolStrips\ToolStripOverflow.cs (1)
96
return base.
GetPreferredSize
(constrainingSize);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (3)
273
preferredSize = _wrappedToolStrip.
GetPreferredSize
(constrainingSize);
279
preferredSize = _wrappedToolStrip.
GetPreferredSize
(constrainingSize);
285
preferredSize = (!_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)
94
int textBoxPreferredHeight = _textBox.
GetPreferredSize
(new Size(int.MaxValue, int.MaxValue)).Height;
System.Windows.Forms.Tests (32)
System\Windows\Forms\ControlTests.Methods.cs (6)
2370
Assert.Equal(Size.Empty, control.
GetPreferredSize
(proposedSize));
2374
Assert.Equal(Size.Empty, control.
GetPreferredSize
(proposedSize));
2386
Assert.Equal(new Size(30, 40), control.
GetPreferredSize
(proposedSize));
2390
Assert.Equal(new Size(30, 40), control.
GetPreferredSize
(proposedSize));
2426
Assert.Equal(expected, control.
GetPreferredSize
(proposedSize));
2430
Assert.Equal(expected, control.
GetPreferredSize
(proposedSize));
System\Windows\Forms\ListBoxTests.cs (8)
4806
Assert.Equal(new Size(120, 96), control.
GetPreferredSize
(proposedSize));
4810
Assert.Equal(new Size(120, 96), control.
GetPreferredSize
(proposedSize));
4823
Assert.Equal(new Size(120, 96), control.
GetPreferredSize
(proposedSize));
4827
Assert.Equal(new Size(120, 96), control.
GetPreferredSize
(proposedSize));
4847
Size result = control.
GetPreferredSize
(proposedSize);
4856
Assert.Equal(result, control.
GetPreferredSize
(proposedSize));
4880
Size result = control.
GetPreferredSize
(proposedSize);
4889
Assert.Equal(result, control.
GetPreferredSize
(proposedSize));
System\Windows\Forms\UpDownBaseTests.cs (6)
1593
Size preferredSize = control.
GetPreferredSize
(proposedSize);
1597
preferredSize = control.
GetPreferredSize
(proposedSize);
1614
Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.
GetPreferredSize
(proposedSize));
1618
Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.
GetPreferredSize
(proposedSize));
1657
Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.
GetPreferredSize
(proposedSize));
1661
Assert.Equal(new Size(expectedWidth, control.PreferredHeight), control.
GetPreferredSize
(proposedSize));
TextBoxBaseTests.cs (12)
5027
Assert.Equal(expected, control.
GetPreferredSize
(proposedSize));
5031
Assert.Equal(expected, control.
GetPreferredSize
(proposedSize));
5047
Assert.Equal(expected + padding.Size, control.
GetPreferredSize
(proposedSize));
5051
Assert.Equal(expected + padding.Size, control.
GetPreferredSize
(proposedSize));
5087
Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.
GetPreferredSize
(proposedSize));
5091
Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.
GetPreferredSize
(proposedSize));
5107
Size result = control.
GetPreferredSize
(proposedSize);
5113
result = control.
GetPreferredSize
(proposedSize);
5130
Size result = control.
GetPreferredSize
(proposedSize);
5131
Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.
GetPreferredSize
(proposedSize));
5135
result = control.
GetPreferredSize
(proposedSize);
5136
Assert.Equal(new Size(width + expectedAdditionalWidth, expectedHeight), control.
GetPreferredSize
(proposedSize));
WindowsFormsIntegration (2)
System\Windows\Integration\ElementHost.cs (1)
97
return base.
GetPreferredSize
(proposedSize);
System\Windows\Integration\WindowsFormsHost.cs (1)
248
SD.Size preferredSize = Child.
GetPreferredSize
(constraintSize);