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 一起顺利调整其容器的大小。

适用于

另请参阅