{"id":4685,"date":"2012-09-12T14:20:00","date_gmt":"2012-09-12T22:20:00","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/?p=4685"},"modified":"2012-09-12T14:20:18","modified_gmt":"2012-09-12T22:20:18","slug":"spotlight-on-the-statusstrip-control","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2012\/09\/12\/spotlight-on-the-statusstrip-control\/","title":{"rendered":"Spotlight on the StatusStrip Control"},"content":{"rendered":"<p><em>The \u201cSpotlight on Controls\u201d series focuses on a single WinForms control in PowerShell Studio 2012, details the important Properties, Methods, and Events of the control and demonstrates how to utilize the control. Most of the information about the controls is still applicable to previous versions of PrimalForms.<\/em><\/p>\n<p><em><font color=\"#ff0000\">Note: The StatusStrip control is only available for PowerShell Studio 2012 v3.0.6 or greater<\/font><\/em><\/p>\n<p>Last time we took a look at the StatusBar control. This time we will look at the StatusStrip control:<\/p>\n<p><span style=\"font-size: medium\"><strong>StatusStrip<\/strong>[System.Windows.Forms.StatusStrip]<\/span><\/p>\n<p>Represents a Windows status bar control. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"StatusStrip Toolbox Icon\" border=\"0\" alt=\"StatusStrip Toolbox Icon\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/StatusStrip-Toolbox-Icon.png\" width=\"110\" height=\"23\"><\/p>\n<p>Default Event: ItemClick <\/p>\n<p><em>Why use a StatusStrip control?<\/em><\/p>\n<p>Use the StatusStrip control, to display status information to the user. The StatusStrip serves as a replacement to the StatusBar and also offers more support for user interaction than the StatusBar by allowing you to add buttons, progress bars, and other controls.<\/p>\n<p><strong><font size=\"3\">Important Properties:<\/font><\/strong><\/p>\n<p><strong>AllowItemReorder<\/strong><\/p>\n<p>This property allows the items in the StatusStrip to be reordered when the ALT key is pressed.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>SizingGrip<\/strong><\/p>\n<p>This property indicates whether a sizing handle (grip) is displayed in the lower-right corner of the control. This property is mainly cosmetic and should be set to False when using fixed sized forms, such as when the form\u2019s FormBorderStyle property is set to <em>FixedDialog. <\/em>For more details about the Form control and the FormBorderStyle property, please refer to the <a href=\"http:\/\/www.sapien.com\/blog\/2011\/06\/01\/primalforms-2011-spotlight-on-the-form-control\/\">Spotlight on the Form Control<\/a> article.<\/p>\n<p>Default Value: <em>True<\/em><\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"SizingGrip\" border=\"0\" alt=\"SizingGrip\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/SizingGrip.png\" width=\"94\" height=\"36\"><\/em><\/p>\n<p><strong><\/strong>&nbsp;<\/p>\n<p><strong>ShowItemToolTips<\/strong><\/p>\n<p>This property indicates whether ToolTips are shown for the StatusStrip. Set this property to <i>True<\/i> when you want to provide help information for items in the StatusStrip.<\/p>\n<p>Default Value: <em>False<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"ShowItemToolTips\" border=\"0\" alt=\"ShowItemToolTips\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/ShowItemToolTips.png\" width=\"236\" height=\"77\"><\/p>\n<p><strong><\/strong>&nbsp;<\/p>\n<p><strong>LayoutStyle<\/strong><\/p>\n<p>This property indicates how the StatusStrip lays out the items collection.<\/p>\n<p>Values (Default: <em>Table<\/em>):<\/p>\n<blockquote>\n<p><em>StackWithOverflow<\/em><br \/>Specifies that items are laid out automatically.  <\/p>\n<p><em>HorizontalStackWithOverflow<\/em><br \/>Specifies that items are laid out horizontally and overflow as necessary.  <\/p>\n<p><em>VerticalStackWithOverflow<\/em><br \/>Specifies that items are laid out vertically, are centered within the control, and overflow as necessary.  <\/p>\n<p><em>Flow<\/em><br \/>Specifies that items flow horizontally or vertically as necessary.  <\/p>\n<p><em>Table<\/em><br \/>Specifies that items are laid out flush left.<\/p>\n<\/blockquote>\n<p>Note: If you want to ensure all the items on the status bar are visible even when the form is resized then you can use the <em>Flow<\/em> layout style:  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Flow Layout\" border=\"0\" alt=\"Flow Layout\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Flow-Layout.png\" width=\"328\" height=\"81\"><\/p>\n<p>Otherwise the items that do not fit in the StatusStrip (depending on form size) will be hidden from view. <\/p>\n<p><strong>Dock<\/strong><\/p>\n<p>This property indicates which StatusStrip borders are docked to its parent control and determines how a StatusStrip is resized with its parent.<\/p>\n<p>Values (Default: <em>Bottom<\/em>):<\/p>\n<blockquote>\n<p><em>None<\/em><br \/>The control is not docked. The StatusStrip becomes a free floating control that cannot be moved by the user.  <\/p>\n<p><em>Top<\/em><br \/>The control&#8217;s top edge is docked to the top of its containing control.  <\/p>\n<p><em>Bottom<\/em><br \/>The control&#8217;s bottom edge is docked to the bottom of its containing control.  <\/p>\n<p><em>Left<\/em><br \/>The control&#8217;s left edge is docked to the left edge of its containing control.  <\/p>\n<p><em>Right<\/em><br \/>The control&#8217;s right edge is docked to the right edge of its containing control.  <\/p>\n<p><em>Fill<\/em><br \/>All the control&#8217;s edges are docked to the all edges of its containing control and sized appropriately.  <\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/09\/Docking.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Docking\" border=\"0\" alt=\"Docking\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/09\/Docking_thumb.png\" width=\"174\" height=\"244\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<\/blockquote>\n<p><strong>Items<\/strong><\/p>\n<p>This property contains all the items that belong to the StatusStrip. This property consists of a collection of ToolStripItems, which come in various flavors. For more information, refer to the ToolStripItem Types section below.  <\/p>\n<p><strong>Adding Items to the StatusBar<\/strong><\/p>\n<p>Using the Designer:<\/p>\n<p>You can add ToolStripItems directly in the designer by accessing the dropdown inside the StatusStrip:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Add-Items-Directly-in-Designer.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Add Items Directly in Designer\" border=\"0\" alt=\"Add Items Directly in Designer\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Add-Items-Directly-in-Designer_thumb.png\" width=\"244\" height=\"241\"><\/a><\/p>\n<p>Note: To edit the item\u2019s properties you will have to select the ToolStripItem and use the Property Panel.<\/p>\n<p>You can also use the Item Collection Editor to add items to the StatusStrip. <\/p>\n<p>Access the Item Collection Editor using the property panel:  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Property Pane\" border=\"0\" alt=\"Property Pane\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Property-Pane.png\" width=\"247\" height=\"183\"><\/p>\n<p>Or the by using the designer menu:  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Designer menu\" border=\"0\" alt=\"Designer menu\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Designer-menu.png\" width=\"357\" height=\"232\"><\/p>\n<p>The Item Collection Editor allows you to add \/ remove ToolStripItems and alter their properties in a single location:  <\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Items-Collection-Editor.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Items Collection Editor\" border=\"0\" alt=\"Items Collection Editor\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Items-Collection-Editor_thumb.png\" width=\"244\" height=\"151\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Using the Script Editor:<\/p>\n<p>You can add ToolStripItems using the Item property\u2019s Add methods:<\/p>\n<p><font size=\"2\"><span style=\"color: #0000ff\">[ToolStripItem] <\/span><span style=\"color: #4bacc6\">Add <\/span>(<span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">Image] <\/span><span style=\"color: #000000\">image<\/span>)<br \/><\/font><font size=\"2\">Adds a ToolStripItem that displays the specified image to the collection.<br \/><\/font><\/p>\n<p><font size=\"2\"><span style=\"color: #0000ff\">[ToolStripItem] <\/span><span style=\"color: #4bacc6\">Add <\/span>(<span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">String] <\/span><span style=\"color: #000000\">text<\/span>)<br \/><\/font><font size=\"2\">Adds a ToolStripItem that displays the specified text to the collection.<br \/><\/font><\/p>\n<p><font size=\"2\"><span style=\"color: #0000ff\">[int] <\/span><span style=\"color: #4bacc6\">Add <\/span>(<span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">ToolStripItem] <\/span><span style=\"color: #000000\">value<\/span>)<br \/><\/font><font size=\"2\">Adds the specified item to the end of the collection.<br \/><\/font><\/p>\n<p><font size=\"2\"><span style=\"color: #0000ff\">[ToolStripItem] <\/span><span style=\"color: #4bacc6\">Add <\/span>(<span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">String] <\/span><span style=\"color: #000000\">text, <span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">Image] <\/span><span style=\"color: #000000\">image<\/span><\/span>)<br \/><\/font><font size=\"2\">Adds a ToolStripItem that displays the specified image and text to the collection.<br \/><\/font><\/p>\n<p><font size=\"2\"><span style=\"color: #0000ff\">[ToolStripItem] <\/span><span style=\"color: #4bacc6\">Add <\/span>(<span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">String] <\/span><span style=\"color: #000000\">text, <span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">Image] <\/span><span style=\"color: #000000\">image, <span style=\"color: #0000ff\">[<\/span><span style=\"color: #0000ff\">EventHandler] <\/span><span style=\"color: #000000\">onClick<\/span><\/span><\/span>)<br \/><\/font><font size=\"2\">Adds a ToolStripItem that displays the specified image and text to the collection and that raises the Click event.<\/font><\/p>\n<p>Example Code:<\/p>\n<pre><span style=\"color: #8b0000\">$clickEvent<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #000000\"> {\n    <\/span><span style=\"color: #0000ff; font-weight: bold\">Write-Host<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #ff0000\">'Click'<\/span><span style=\"color: #000000\">\n}\n<\/span><span style=\"color: #8b0000\"><br><\/span><\/pre>\n<pre><span style=\"color: #8b0000\">$image<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #000000\"> [System.Drawing.Image]<\/span><span style=\"color: #0000ff\">::<\/span><span style=\"color: #000000\">FromFile(<\/span><span style=\"color: #ff0000\">'c:\\image.png'<\/span><span style=\"color: #000000\">)\n<\/span><span style=\"color: #8b0000\"><br>$statusstrip1<\/span><span style=\"color: #000000\">.Items.Add(<\/span><span style=\"color: #ff0000\">'Text'<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #8b0000\">$image<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #8b0000\">$clickEvent<\/span><span style=\"color: #000000\">)<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><font size=\"3\"><strong>Important Events:<\/strong><\/font><\/p>\n<p><strong>ItemClicked<\/strong><\/p>\n<p>This event occurs when a ToolStripItem is clicked. This event allows you to handle all the click events in one location, but it is not recommend using this event if you are have DropDownButtons or SplitButtons. Instead you should use each ToolStripItem\u2019s individual event handlers.<\/p>\n<pre><span style=\"color: #8b0000\">$statusstrip1_ItemClicked<\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #000000\">[System.Windows.Forms.ToolStripItemClickedEventHandler]{\n<\/span><span style=\"color: #008000\">#Event Argument: $_ = [System.Windows.Forms.ToolStripItemClickedEventArgs]<\/span><span style=\"color: #000000\">\n\n    <\/span><span style=\"color: #0000ff; font-weight: bold\">Write-Host<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #8b0000\">$_<\/span><span style=\"color: #000000\">.ClickedItem.Text\n<\/span><\/pre>\n<pre><span style=\"color: #000000\">    <\/span><span style=\"color: #0000ff\">if<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #8b0000\">$_<\/span><span style=\"color: #000000\">.ClickedItem <\/span><span style=\"color: #0000ff\">-eq<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #8b0000\">$toolstripstatuslabel1<\/span><span style=\"color: #000000\">)\n    {\n        <\/span><span style=\"color: #0000ff; font-weight: bold\">Write-Host<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #ff0000\">\"You clicked the label\"<\/span><span style=\"color: #000000\">\n    } \n}<\/span><\/pre>\n<p><strong><font size=\"3\"><\/font><\/strong>&nbsp;<\/p>\n<p><strong><font size=\"3\">ToolStripItem Types:<\/font><\/strong><\/p>\n<p>You can add a variety of items to the StatusStrip, which are presented below. <\/p>\n<p>The following properties are shared with all the types of ToolStripItems, with the exception of the ProgressBar which only shares the ToolTipText property:<\/p>\n<p><strong>Important Shared Properties<\/strong>:<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"578\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"147\"><strong>Property<\/strong><\/td>\n<td valign=\"top\" width=\"429\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"147\">ToolTipText<\/td>\n<td valign=\"top\" width=\"429\">\n<p>Specifies the text to show on the Tooltip.<br \/>If this property is not set and the AutoToolTip property is set to <i>True<\/i>, the item will use the Text property as its ToolTip.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"147\">DisplayStyle<\/td>\n<td valign=\"top\" width=\"429\">Specifies whether text and images are displayed on an item.<br \/>Values:<\/p>\n<p><em>None<\/em><br \/>Specifies that neither image nor text is to be rendered for this item. <\/p>\n<p><em>Text<\/em><br \/>Specifies that only text is to be rendered for this item. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Text Only\" border=\"0\" alt=\"Text Only\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Text-Only.png\" width=\"233\" height=\"52\"> <\/p>\n<p><em>Image<\/em><br \/>Specifies that only an image is to be rendered for this item. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Image Only\" border=\"0\" alt=\"Image Only\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Image-Only.png\" width=\"235\" height=\"54\"> <\/p>\n<p><em>ImageAndText<\/em><br \/>Specifies that both an image and text are to be rendered for this item. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Image and Text\" border=\"0\" alt=\"Image and Text\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Image-and-Text.png\" width=\"231\" height=\"54\"><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"147\">Image<\/td>\n<td valign=\"top\" width=\"429\">The image that will be displayed on the item.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"147\">ImageScaling<\/td>\n<td valign=\"top\" width=\"429\">Indicates whether the image on the item will automatically resize to fit in the StatusStrip.<br \/>Values:<\/p>\n<p><em>None<\/em><br \/>Specifies that the size of the image on an item is not automatically adjusted to fit on a StatusStrip. The image retains its original size. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"ImageScaling None\" border=\"0\" alt=\"ImageScaling None\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/ImageScaling-None.png\" width=\"217\" height=\"42\"> <\/p>\n<p><em>SizeToFit<\/em><br \/>Specifies that the size of the image on an item is automatically adjusted to fit on a StatusStrip. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"ImageScaling SizeToFit\" border=\"0\" alt=\"ImageScaling SizeToFit\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/ImageScaling-SizeToFit.png\" width=\"217\" height=\"26\"><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"147\">Text<\/td>\n<td valign=\"top\" width=\"429\">The text that is to be displayed on the item.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"147\">TextImageRelation<\/td>\n<td valign=\"top\" width=\"429\">The position of the item\u2019s text and image relative to each other.<br \/>Values:<\/p>\n<p><em>Overlay<\/em><br \/>Specifies that the image and text share the same space on a control.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"TextImageRelation Overlay\" border=\"0\" alt=\"TextImageRelation Overlay\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/TextImageRelation-Overlay.png\" width=\"152\" height=\"26\"><\/p>\n<p><em>ImageBeforeText<\/em><br \/>Specifies that the image is displayed horizontally before the text of a control.<br \/><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"TextImageRelation Image Before\" border=\"0\" alt=\"TextImageRelation Image Before\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/TextImageRelation-Image-Before.png\" width=\"152\" height=\"26\"> <\/p>\n<p><em>TextBeforeImage<\/em><br \/>Specifies that the text is displayed horizontally before the image of a control.<br \/><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"TextImageRelation Text Before\" border=\"0\" alt=\"TextImageRelation Text Before\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/TextImageRelation-Text-Before.png\" width=\"152\" height=\"26\"> <\/p>\n<p><em>ImageAboveText<\/em><br \/>Specifies that the image is displayed vertically above the text of a control.<br \/><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"TextImageRelation Image Above\" border=\"0\" alt=\"TextImageRelation Image Above\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/TextImageRelation-Image-Above.png\" width=\"152\" height=\"41\"> <\/p>\n<p><em>TextAboveImage<\/em><br \/>Specifies that the text is displayed vertically above the image of a control.<br \/><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"TextImageRelation Text Above\" border=\"0\" alt=\"TextImageRelation Text Above\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/TextImageRelation-Text-Above.png\" width=\"152\" height=\"41\"><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"147\">DoubleClickEnabled<\/td>\n<td valign=\"top\" width=\"429\">Indicated whether the item can be activated by double-clicking the mouse.<br \/>Values: <em>True \/ False<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Important Shared Events:<\/strong><\/p>\n<p>The following events are shared with all the types of ToolStripItems: <\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"452\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"140\"><strong>Event<\/strong><\/td>\n<td valign=\"top\" width=\"310\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">Click<\/td>\n<td valign=\"top\" width=\"310\">Occurs when the item is clicked.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">DoubleClick<\/td>\n<td valign=\"top\" width=\"310\">Occurs when the item is clicked. <br \/>Note: Order for this event to be triggered, some types require that the DoubleClickEnabled property to be set to <em>True.<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>The following is a list of ToolStripItems types that can be added to the StatusStrip control:<\/p>\n<p><font size=\"3\"><strong>StatusLabel <\/strong>[System.Windows.Forms.ToolStripStatusLabel]<\/font><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Status Label\" border=\"0\" alt=\"Status Label\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Status-Label.png\" width=\"160\" height=\"26\"><\/p>\n<p>Represents a panel in a StatusStrip control. Use the StatusLabel to show text and\/or an image.<\/p>\n<p><strong>Important Properties<\/strong>:<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"557\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"140\"><strong>Properties<\/strong><\/td>\n<td valign=\"top\" width=\"415\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">BorderSides<\/td>\n<td valign=\"top\" width=\"415\">Indicates which sides of the ToolStripStatusLabel show borders.<br \/>Values:<br \/>None, Top, Left, Right, Bottom, All<br \/><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"BorderSides - Right\" border=\"0\" alt=\"BorderSides - Right\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/BorderSides-Right.png\" width=\"160\" height=\"28\"><br \/><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"BorderSide - All\" border=\"0\" alt=\"BorderSide - All\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/BorderSide-All.png\" width=\"160\" height=\"28\"><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">BorderStyles<\/td>\n<td valign=\"top\" width=\"415\">Indicates the border style of the ToolStripStatusLabel.<\/p>\n<p>Values (Default: <em>Flat<\/em>):<\/p>\n<p><em>Adjust<\/em><br \/>The border is drawn outside the specified rectangle, preserving the dimensions of the rectangle for drawing. <\/p>\n<p>&nbsp;<em>Bump<\/em><br \/>The inner and outer edges of the border have a raised appearance. <\/p>\n<p>&nbsp;<em>Etched<\/em><br \/>The inner and outer edges of the border have an etched appearance. <\/p>\n<p>&nbsp;<em>Flat<\/em><br \/>The border has no three-dimensional effects. <\/p>\n<p>&nbsp;<em>Raised<\/em><br \/>The border has raised inner and outer edges. <\/p>\n<p>&nbsp;<em>RaisedInner<\/em><br \/>The border has a raised inner edge and no outer edge. <\/p>\n<p>&nbsp;<em>RaisedOuter<\/em><br \/>The border has a raised outer edge and no inner edge. <\/p>\n<p><em>Sunken<\/em><br \/>The border has sunken inner and outer edges. <\/p>\n<p><em>SunkenInner<\/em><br \/>The border has a sunken inner edge and no outer edge. <\/p>\n<p><em>SunkenOuter<\/em><br \/>The border has a sunken outer edge and no inner edge.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"BorderStyles\" border=\"0\" alt=\"BorderStyles\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/09\/BorderStyles.png\" width=\"271\" height=\"275\"><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">Spring<\/td>\n<td valign=\"top\" width=\"415\">Indicates whether the ToolStripStatusLabel automatically fills the available space on the StatusStrip as the form is resized. <\/p>\n<p>Values: <em>True \/ False<br \/><\/em><br \/><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Spring\" border=\"0\" alt=\"Spring\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Spring.png\" width=\"333\" height=\"39\"><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">IsLink<\/td>\n<td valign=\"top\" width=\"415\">Indicated whether the ToolStripLabel is a hyperlink. <\/p>\n<p>Values: <em>True \/ False<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Label as Link\" border=\"0\" alt=\"Label as Link\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Label-as-Link.png\" width=\"199\" height=\"53\"><\/em><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">LinkBehavior<\/td>\n<td valign=\"top\" width=\"415\">Indicates the behavior of a link.<\/p>\n<p>Values (Default: <em>SystemDefault<\/em>):<\/p>\n<p><em>SystemDefault<\/em><br \/>The behavior of this setting depends on the options set using the Internet Options dialog box in Control Panel or Internet Explorer. <\/p>\n<p><em>AlwaysUnderline<\/em><br \/>The link always displays with underlined text. <\/p>\n<p><em>HoverUnderline<\/em><br \/>The link displays underlined text only when the mouse is hovered over the link text. <\/p>\n<p><em>NeverUnderline<\/em><br \/>The link text is never underlined. The link can still be distinguished from other text by use of the LinkColor property.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Making a Link Functional:<\/strong><\/p>\n<p>In order to have the Label open a webpage you will need to handle the label\u2019s Click event:<\/p>\n<pre><span style=\"color: #8b0000\">$toolstripstatuslabelLink_Click<\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #000000\">{\n    <\/span><span style=\"color: #008000\">#Open the URL in the Default Application<\/span><span style=\"color: #000000\">\n    [System.Diagnostics.Process]<\/span><span style=\"color: #0000ff\">::<\/span><span style=\"color: #000000\">Start(<\/span><span style=\"color: #8b0000\">$this<\/span><span style=\"color: #000000\">.Text)\n}<\/span><\/pre>\n<p>In the case where you don\u2019t want the text to show the actual link, you can instead store the link in the label\u2019s Tag property:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Tag Property\" border=\"0\" alt=\"Tag Property\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Tag-Property.png\" width=\"273\" height=\"83\"><\/p>\n<p>And modify the Click event as follows:<\/p>\n<pre><span style=\"color: #8b0000\">$toolstripstatuslabelLink_Click<\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #000000\">{\n    <\/span><span style=\"color: #008000\">#Show the URL stored in the TAG property<\/span><span style=\"color: #000000\">\n    <\/span><span style=\"color: #0000ff\">if<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #8b0000\">$this<\/span><span style=\"color: #000000\">.Tag <\/span><span style=\"color: #0000ff\">-is<\/span><span style=\"color: #000000\"> [string])\n    {\n        [System.Diagnostics.Process]<\/span><span style=\"color: #0000ff\">::<\/span><span style=\"color: #000000\">Start(<\/span><span style=\"color: #8b0000\">$this<\/span><span style=\"color: #000000\">.Tag)\n    }\n}<\/span><\/pre>\n<p><font size=\"3\"><strong><\/strong><\/font>&nbsp;<\/p>\n<p><font size=\"3\"><strong>ProgressBar<\/strong> [System.Windows.Forms.ToolStripProgressBar]<\/font><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"ProgressBar\" border=\"0\" alt=\"ProgressBar\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/ProgressBar.png\" width=\"160\" height=\"26\"><\/p>\n<p>Represents a Windows progress bar control contained in a StatusStrip. Use the Progress bar to show the total progress of an operation. <\/p>\n<p><strong>Important Properties:<\/strong><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"566\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"140\"><strong>Properties<\/strong><\/td>\n<td valign=\"top\" width=\"424\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">Maximum<\/td>\n<td valign=\"top\" width=\"424\">The upper bound of the range that is defined for this ToolStripProgressBar.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">Minimum<\/td>\n<td valign=\"top\" width=\"424\">The lower bound of the range that is defined for this ToolStripProgressBar.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">Step<\/td>\n<td valign=\"top\" width=\"424\">The amount by which to increment the current value of the ToolStripProgressBar when the PerformStep method is called.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">Value<\/td>\n<td valign=\"top\" width=\"424\">Indicates the current value of the ToolStripProgressBar.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Please refer to the <a href=\"http:\/\/www.sapien.com\/blog\/2011\/07\/14\/primalforms-2011-spotlight-on-the-progressbar-control\/\">Spotlight on the ProgressBar Control<\/a> blog article for more details on the progress bar.<\/p>\n<p><font size=\"3\"><strong><\/strong><\/font>&nbsp;<\/p>\n<p><font size=\"3\"><strong>DropDownButton<\/strong> [System.Windows.Forms.ToolStripDropDownButton]<\/font><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"DropDownButton\" border=\"0\" alt=\"DropDownButton\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/DropDownButton1.png\" width=\"179\" height=\"88\"><\/p>\n<p>Represents a button that when clicked displays an associated menu from which the user can select a single item. <\/p>\n<p><strong>Important Properties:<\/strong><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"568\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"140\"><strong>Properties<\/strong><\/td>\n<td valign=\"top\" width=\"426\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">DropDown<\/td>\n<td valign=\"top\" width=\"426\">Specifies a ToolStripDropDown (such as a ContextMenuStrip) that will be displayed when this item is clicked.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">DropDownItems<\/td>\n<td valign=\"top\" width=\"426\">Specifies a ToolStripItem to display when this item is clicked.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">ShowDropDownArrow<\/td>\n<td valign=\"top\" width=\"426\">Specifies whether an arrow is displayed on the item, which indicates that further options are available in a drop-down list.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Important Events:<\/strong><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"573\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"140\"><strong>Properties<\/strong><\/td>\n<td valign=\"top\" width=\"431\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">DropDownItemClicked <\/td>\n<td valign=\"top\" width=\"431\">Occurs when the ToolStripDropDown is clicked.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><pre><span style=\"color: #8b0000\">$toolstripdropdownbutton2_DropDownItemClicked<\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #000000\">[System.Windows.Forms.ToolStripItemClickedEventHandler]{\n<\/span><span style=\"color: #008000\">#Event Argument: $_ = [System.Windows.Forms.ToolStripItemClickedEventArgs]<\/span><span style=\"color: #000000\">\n    <\/span><span style=\"color: #0000ff; font-weight: bold\">Write-Host<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #8b0000\">$_<\/span><span style=\"color: #000000\">.ClickedItem.Text\n}<\/span><\/pre>\n<p>Please refer to the <a href=\"http:\/\/www.sapien.com\/blog\/2011\/12\/16\/primalforms-2011-spotlight-on-the-contextmenustrip-control\/\">Spotlight on the ContextMenuStrip Control<\/a> blog article for more details on the menus. <\/p>\n<p><strong>Making an ordinary button:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"Normal Button\" border=\"0\" alt=\"Normal Button\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/Normal-Button.png\" width=\"77\" height=\"55\"><br \/>In order to make a DropDownButton function like an ordinary button, you must do the following:<\/p>\n<blockquote>\n<p>1. Set the ShowDropDownArrow property to False.<br \/>2. Clear any DropDown Items from the button.<br \/>3. Create an event handler for the DropDownButton\u2019s Click event.<\/p>\n<\/blockquote>\n<p><font size=\"3\"><strong><\/p>\n<p>SplitButton<\/strong> [System.Windows.Forms.ToolStripSplitButton]<\/font><\/p>\n<p><font size=\"3\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px\" title=\"SplitButton\" border=\"0\" alt=\"SplitButton\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2012\/08\/SplitButton.png\" width=\"160\" height=\"26\"><\/font><\/p>\n<p>Represents a combination of a standard button on the left and a drop-down button on the right, or the other way around if the value of RightToLeft is <em>Yes<\/em>.<\/p>\n<p><strong>Important Properties<\/strong>:<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"571\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"140\"><strong>Properties<\/strong><\/td>\n<td valign=\"top\" width=\"429\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">DropDown<\/td>\n<td valign=\"top\" width=\"429\">Specifies a ToolStripDropDown (such as a ContextMenuStrip) that will be displayed when this item is clicked.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">DropDownItems<\/td>\n<td valign=\"top\" width=\"429\">Specifies a ToolStripItem to display when this item is clicked.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><\/strong>&nbsp;<\/p>\n<p><strong>Important Events:<\/strong><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"573\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"140\"><strong>Properties<\/strong><\/td>\n<td valign=\"top\" width=\"431\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">Click<\/td>\n<td valign=\"top\" width=\"431\">Occurs when the button is clicked.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"140\">DropDownItemClicked <\/td>\n<td valign=\"top\" width=\"431\">Occurs when the ToolStripDropDown is clicked.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Please refer to the <a href=\"http:\/\/www.sapien.com\/blog\/2011\/12\/16\/primalforms-2011-spotlight-on-the-contextmenustrip-control\/\">Spotlight on the ContextMenuStrip Control<\/a> blog article for more details on the menus.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The \u201cSpotlight on Controls\u201d series focuses on a single WinForms control in PowerShell Studio 2012, details the important Properties, Methods, and Events of the control and demonstrates how to utilize the control. Most of the information about the controls is still applicable to previous versions of PrimalForms. Note: The StatusStrip control is only available for [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[705,509,644,25],"tags":[641,28,633,744,312],"class_list":["post-4685","post","type-post","status-publish","format-standard","hentry","category-powershell-studio-2012","category-primalforms-software-news","category-spotlight-on-controls","category-windows-powershell","tag-controls","tag-powershell","tag-primalforms-2011","tag-statusstrip","tag-winforms"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/4685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=4685"}],"version-history":[{"count":10,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/4685\/revisions"}],"predecessor-version":[{"id":4804,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/4685\/revisions\/4804"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=4685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=4685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=4685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}