Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-use-the-spring-property-interactively-in-a-statusstrip.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

2.6 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Use the Spring Property Interactively in a StatusStrip 03/30/2017
csharp
vb
StatusStrip control [Windows Forms]
ToolStrip control [Windows Forms]
status bars [Windows Forms], examples
Spring property [Windows Forms]
18bde842-a93c-48dd-9db3-15738a1775ce

How to: Use the Spring Property Interactively in a StatusStrip

You can use the xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A property to position a xref:System.Windows.Forms.ToolStripStatusLabel control in a xref:System.Windows.Forms.StatusStrip control. The xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A property determines whether the xref:System.Windows.Forms.ToolStripStatusLabel control automatically fills the available space on the xref:System.Windows.Forms.StatusStrip control.

Example

The following code example demonstrates how to use the xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A property to position a xref:System.Windows.Forms.ToolStripStatusLabel control in a xref:System.Windows.Forms.StatusStrip control. The xref:System.Windows.Forms.ToolStripItem.Click event handler performs an exclusive-or (XOR) operation to switch the value of the xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A property.

To use this code example, compile and run the application, and then click Middle (Spring) on the xref:System.Windows.Forms.StatusStrip control to switch the value of the xref:System.Windows.Forms.ToolStripStatusLabel.Spring%2A property.

[!code-csharpSystem.Windows.Forms.ToolStrip.Misc#1] [!code-vbSystem.Windows.Forms.ToolStrip.Misc#1]
[!code-csharpSystem.Windows.Forms.ToolStrip.Misc#50] [!code-vbSystem.Windows.Forms.ToolStrip.Misc#50]

Compiling the Code

This example requires:

  • References to the System.Design, System.Drawing, and System.Windows.Forms assemblies.

See also