--- title: "How to: Use the Spring Property Interactively in a StatusStrip" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "StatusStrip control [Windows Forms]" - "ToolStrip control [Windows Forms]" - "status bars [Windows Forms], examples" - "Spring property [Windows Forms]" ms.assetid: 18bde842-a93c-48dd-9db3-15738a1775ce --- # How to: Use the Spring Property Interactively in a StatusStrip You can use the property to position a control in a control. The property determines whether the control automatically fills the available space on the control. ## Example The following code example demonstrates how to use the property to position a control in a control. The event handler performs an exclusive-or (XOR) operation to switch the value of the property. To use this code example, compile and run the application, and then click **Middle (Spring)** on the control to switch the value of the property. [!code-csharp[System.Windows.Forms.ToolStrip.Misc#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#1)] [!code-vb[System.Windows.Forms.ToolStrip.Misc#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#1)] [!code-csharp[System.Windows.Forms.ToolStrip.Misc#50](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#50)] [!code-vb[System.Windows.Forms.ToolStrip.Misc#50](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#50)] ## Compiling the Code This example requires: - References to the System.Design, System.Drawing, and System.Windows.Forms assemblies. ## See also - - - - - - [ToolStrip Control](toolstrip-control-windows-forms.md)