ToolStripComboBox.DefaultSize 屬性

定義

取得 ToolStripComboBox 的預設大小。Gets the default size of the ToolStripComboBox.

protected:
 virtual property System::Drawing::Size DefaultSize { System::Drawing::Size get(); };
protected override System.Drawing.Size DefaultSize { get; }
member this.DefaultSize : System.Drawing.Size
Protected Overrides ReadOnly Property DefaultSize As Size

屬性值

Size 的預設 ToolStripTextBox (以像素為單位)。The default Size of the ToolStripTextBox in pixels. 預設大小為 100 x 20 像素。The default size is 100 x 20 pixels.

備註

注意

為了維持較佳的效能,您不應該在其「函式」中設定 ToolStripComboBoxSizeIn order to maintain better performance, you should not set the Size of a ToolStripComboBox in its constructor. 慣用的方法是覆寫 DefaultSize 屬性。The preferred method is to override the DefaultSize property.

給繼承者的注意事項

覆寫衍生類別中的 DefaultSize 屬性時,最好是傳回具有所需維度的 Size 物件,而不是覆寫所有的實作為。When overriding the DefaultSize property in a derived class, it is preferable to return a Size object with the desired dimensions rather than overriding all the implementation.

適用於