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