108 references to PreferredSize
System.Windows.Forms (21)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1182
Size preferredSize =
PreferredSize
;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (1)
214
preferredHeight = txtEditingControl.
PreferredSize
.Height;
System\Windows\Forms\Controls\Labels\Label.cs (5)
642
public virtual int PreferredHeight =>
PreferredSize
.Height;
652
public virtual int PreferredWidth =>
PreferredSize
.Width;
839
Size preferredSize = (AutoSize) ?
PreferredSize
: new Size(saveWidth, saveHeight);
1393
Size preferredSize =
PreferredSize
;
1400
Debug.Assert(!AutoSize || (AutoSize && !SelfSizing) || Size ==
PreferredSize
,
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
964
Size =
PreferredSize
;
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
366
public new Size PreferredSize => base.
PreferredSize
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (1)
640
controlArray[i].Size = controlArray[i].
PreferredSize
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (8)
160
if (MaximumSize.Height >= Control.
PreferredSize
.Height)
169
if (MaximumSize.Height + growBy >= Control.
PreferredSize
.Height)
171
int freed = Control.
PreferredSize
.Height - MaximumSize.Height;
179
if (MaximumSize.Height + growBy < Control.
PreferredSize
.Height)
193
if (MaximumSize.Width >= Control.
PreferredSize
.Width)
202
if (MaximumSize.Width + growBy >= Control.
PreferredSize
.Width)
204
int freed = Control.
PreferredSize
.Width - MaximumSize.Width;
212
if (MaximumSize.Width + growBy < Control.
PreferredSize
.Width)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (1)
438
int controlToDragWidth = (toolStripToDrag.AutoSize) ? toolStripToDrag.
PreferredSize
.Width : toolStripToDrag.Width;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (1)
444
int controlToDragWidth = (toolStripToDrag.AutoSize) ? toolStripToDrag.
PreferredSize
.Height : toolStripToDrag.Height;
System\Windows\Forms\Form.cs (1)
4203
Size prefSize =
PreferredSize
;
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\BorderSidesEditor.BorderSidesEditorUI.cs (1)
35
Size =
PreferredSize
;
System.Windows.Forms.Design.Tests (1)
System\ComponentModel\Design\ByteViewerTests.cs (1)
102
Assert.Equal(new Size(4, 4), control.
PreferredSize
);
System.Windows.Forms.Tests (85)
System\Windows\Forms\AxHostTests.cs (2)
95
Assert.Equal(new Size(75, 23), control.
PreferredSize
);
189
Assert.Equal(new Size(75, 23), control.
PreferredSize
);
System\Windows\Forms\ButtonBaseTests.cs (1)
96
Assert.Throws<NullReferenceException>(() => control.
PreferredSize
);
System\Windows\Forms\ButtonTests.cs (1)
96
Assert.Equal(new Size(75, 23), control.
PreferredSize
);
System\Windows\Forms\CheckBoxTests.cs (2)
97
Assert.True(control.
PreferredSize
.Width > 0);
98
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\ComboBoxTests.cs (1)
108
Assert.Equal(new Size(121, control.PreferredHeight), control.
PreferredSize
);
System\Windows\Forms\ContainerControlTests.cs (1)
100
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\ControlTests.cs (5)
78
Assert.Equal(Size.Empty, control.
PreferredSize
);
167
Assert.Equal(Size.Empty, control.
PreferredSize
);
263
Assert.Equal(new Size(width, height), control.
PreferredSize
);
359
Assert.Equal(Size.Empty, control.
PreferredSize
);
455
Assert.Equal(new Size(width, height), control.
PreferredSize
);
System\Windows\Forms\ControlTests.Properties.cs (4)
9843
Assert.Equal(new Size(0, 0), control.
PreferredSize
);
9846
Assert.Equal(new Size(0, 0), control.
PreferredSize
);
9861
Assert.Equal(new Size(0, 0), control.
PreferredSize
);
9864
Assert.Equal(new Size(0, 0), control.
PreferredSize
);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (2)
98
Assert.Equal(4, control.
PreferredSize
.Width);
99
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\DateTimePickerTests.cs (1)
98
Assert.Equal(new Size(200, control.PreferredHeight), control.
PreferredSize
);
System\Windows\Forms\Design\ComponentEditorFormTests.cs (2)
130
Assert.True(control.
PreferredSize
.Width > 0);
131
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\Design\ComponentEditorPageTests.cs (1)
102
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\DomainUpDownTests.cs (2)
60
_sub.
PreferredSize
.Should().Be(new Size(16, _sub.PreferredHeight));
67
_sub.
PreferredSize
.Should().Be(new Size(20, _sub.PreferredHeight));
System\Windows\Forms\FlowLayoutPanelTests.cs (1)
94
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\FormTests.cs (2)
132
Assert.True(control.
PreferredSize
.Width > 0);
133
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\GroupBoxTests.cs (3)
83
Assert.Equal(new Size(6, 6 + Control.DefaultFont.Height), control.
PreferredSize
);
930
Assert.Equal(new Size(22, 25), control.
PreferredSize
);
940
Assert.Equal(new Size(8, 9), control.
PreferredSize
);
System\Windows\Forms\HScrollBarTests.cs (2)
92
Assert.True(control.
PreferredSize
.Width > 0);
93
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\LabelTests.cs (4)
88
Assert.Equal(0, control.
PreferredSize
.Width);
89
Assert.True(control.
PreferredSize
.Height > 0);
873
Size defaultSize = label.
PreferredSize
;
876
Assert.NotEqual(defaultSize, label.
PreferredSize
);
System\Windows\Forms\ListBoxTests.cs (1)
101
Assert.Equal(new Size(120, 96), control.
PreferredSize
);
System\Windows\Forms\ListControlTests.cs (1)
89
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\ListViewTests.cs (1)
116
Assert.Equal(new Size(121, 97), control.
PreferredSize
);
System\Windows\Forms\MdiClientTests.cs (1)
68
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\MenuStripTests.cs (2)
118
Assert.True(control.
PreferredSize
.Width > 0);
119
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\MonthCalendarTests.cs (2)
104
Assert.True(control.
PreferredSize
.Width > 0);
105
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\PanelTests.cs (3)
94
Assert.Equal(Size.Empty, control.
PreferredSize
);
617
Assert.Equal(new Size(19, 23), control.
PreferredSize
);
632
Assert.Equal(new Size(26, 31), control.
PreferredSize
);
System\Windows\Forms\PictureBoxTests.cs (1)
89
Assert.Equal(new Size(100, 50), control.
PreferredSize
);
System\Windows\Forms\ProgressBarTests.cs (1)
80
Assert.Equal(new Size(100, 23), control.
PreferredSize
);
System\Windows\Forms\PropertyGridTests.cs (1)
129
Assert.NotEqual(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\RadioButtonTests.cs (1)
96
Assert.Equal(new Size(14, 13), control.
PreferredSize
);
System\Windows\Forms\RichTextBoxTests.cs (3)
105
Assert.True(control.
PreferredSize
.Width > 0);
106
Assert.True(control.
PreferredSize
.Height > 0);
107
Assert.Equal(control.
PreferredSize
.Height, control.PreferredHeight);
System\Windows\Forms\ScrollableControlTests.cs (1)
93
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\ScrollBarTests.cs (1)
82
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\SplitterPanelTests.cs (1)
84
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\SplitterTests.cs (1)
82
Assert.Equal(new Size(3, 3), control.
PreferredSize
);
System\Windows\Forms\StatusStripTests.cs (2)
117
Assert.True(control.
PreferredSize
.Width > 0);
118
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\TabControlTests.cs (1)
86
Assert.Equal(new Size(200, 100), control.
PreferredSize
);
System\Windows\Forms\TableLayoutPanelTests.cs (1)
102
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\ToolStripContentPanelTests.cs (1)
96
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\ToolStripDropDownTests.cs (2)
126
Assert.True(control.
PreferredSize
.Width > 0);
127
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\ToolStripPanelTests.cs (1)
96
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\ToolStripTests.cs (4)
134
Assert.True(control.
PreferredSize
.Width > 0);
135
Assert.True(control.
PreferredSize
.Height > 0);
289
Assert.True(control.
PreferredSize
.Width > 0);
290
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\TreeViewTests.cs (1)
97
Assert.Equal(new Size(121, 97), control.
PreferredSize
);
System\Windows\Forms\UpDownBaseTests.cs (6)
47
Assert.Equal(new Size(122, control.PreferredHeight), control.
PreferredSize
);
54
Assert.Equal(new Size(123, control.PreferredHeight), control.
PreferredSize
);
741
Assert.Equal(expectedPreferredSize, control.
PreferredSize
);
748
Assert.Equal(expectedPreferredSize, control.
PreferredSize
);
784
Assert.Equal(expectedPreferredSize, control.
PreferredSize
);
794
Assert.Equal(expectedPreferredSize, control.
PreferredSize
);
System\Windows\Forms\UserControlTests.cs (1)
100
Assert.Equal(Size.Empty, control.
PreferredSize
);
System\Windows\Forms\VScrollBarTests.cs (2)
91
Assert.True(control.
PreferredSize
.Width > 0);
92
Assert.True(control.
PreferredSize
.Height > 0);
System\Windows\Forms\WebBrowserTests.cs (1)
79
Assert.Equal(new Size(250, 250), control.
PreferredSize
);
TextBoxTests.cs (2)
92
Assert.Equal(4, control.
PreferredSize
.Width);
93
Assert.True(control.
PreferredSize
.Height > 0);
TrackBarTests.cs (1)
86
Assert.Equal(new Size(104, s_dimension), control.
PreferredSize
);