共用方式為


ToolStripStatusLabel.Spring 屬性

定義

取得或設定值,指出當表單在調整大小時,ToolStripStatusLabel 是否會自動填滿 StatusStrip 上的可用空間。

public:
 property bool Spring { bool get(); void set(bool value); };
public bool Spring { get; set; }
member this.Spring : bool with get, set
Public Property Spring As Boolean

屬性值

如果表單在調整大小時,ToolStripStatusLabel 會自動填滿 StatusStrip 上的可用空間,則為 true,否則為 false。 預設為 false

範例

下列程式碼範例示範各種 ToolStripStatusLabel 通用屬性的語法,包括 Spring 屬性。

// 
toolStripStatusLabel1.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
            | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
            | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
toolStripStatusLabel1.BorderStyle = System.Windows.Forms.Border3DStyle.Raised;
toolStripStatusLabel1.IsLink = true;
toolStripStatusLabel1.Name = "toolStripStatusLabel1";
toolStripStatusLabel1.Size = new System.Drawing.Size(246, 20);
toolStripStatusLabel1.Spring = true;
toolStripStatusLabel1.Text = "toolStripStatusLabel1";
toolStripStatusLabel1.Alignment = ToolStripItemAlignment.Left;
' 
toolStripStatusLabel1.BorderSides = CType(System.Windows.Forms.ToolStripStatusLabelBorderSides.Left Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Top Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Right Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom, System.Windows.Forms.ToolStripStatusLabelBorderSides)
toolStripStatusLabel1.BorderStyle = System.Windows.Forms.Border3DStyle.Raised
toolStripStatusLabel1.IsLink = True
toolStripStatusLabel1.Name = "toolStripStatusLabel1"
toolStripStatusLabel1.Size = New System.Drawing.Size(246, 20)
toolStripStatusLabel1.Spring = True
toolStripStatusLabel1.Text = "toolStripStatusLabel1"
toolStripStatusLabel1.Alignment = ToolStripItemAlignment.Left

備註

Spring 屬性設定為 true ,讓 ToolStripStatusLabel 與其容器順暢地調整大小。

適用於

另請參閱