Version

UltraStatusBar Class

Represents a Windows style status bar control.
Syntax
'Declaration
 
Public Class UltraStatusBar 
   Inherits Infragistics.Win.UltraControlBase
   Implements Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IStatusBar, Infragistics.Win.IUIElementImageAndTextProvider, Infragistics.Win.IUIElementProvider, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation, Infragistics.Win.UltraWinDock.IDockingArea 
public class UltraStatusBar : Infragistics.Win.UltraControlBase, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IStatusBar, Infragistics.Win.IUIElementImageAndTextProvider, Infragistics.Win.IUIElementProvider, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation, Infragistics.Win.UltraWinDock.IDockingArea  
Remarks

The UltraStatusBar is an enhanced StatusBar control that contains a collection of UltraStatusPanel objects. The UltraStatusPanel supports 13 panel styles. For a complete list, please refer to the UltraStatusPanel.Style property of the UltraStatusPanel. The panels may be hidden by changing the UltraStatusPanel.Visible property or to hide all the panels via the PanelsVisible property.

The panels support 4 different sizing modes. When the UltraStatusPanel.SizingMode is set to Adjustable, the panel's size may be adjusted at design time and run time by dragging the rightmost edge of the panel. Depending on the ResizeStyle, the panel will either be sized during the drag operation or after the mouse is released. The BeforeDragResize and AfterDragResize events fire before and after the drag operation occurs respectively. When the same area of the panel is double clicked, the width of the panel (if the Style supports autosizing) will be set to the UltraStatusPanel.AutoSizeWidth.

The borders for a panel may be controlled for all panels via the BorderStylePanel property or for individual panels via the panel's UltraStatusPanel.BorderStyle property. As with the panel drag events, before and after events (BeforeAutoSizePanel and AfterAutoSizePanel) are fired before the width of the panel is changed.

The UltraStatusBar may also show a size grip. By default, a size grip is only displayed if the status bar is docked to the bottom of the form and the form may be resized. The visibility of the size grip may be changed via the SizeGripVisible property. When the container is about to begin a sizing operation, the BeforeDragSizeGrip event is fired.

Example
The following sample code illustrates how to set up a status bar control at runtime.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinStatusBar
Imports Infragistics.Win.UltraWinProgressBar

Private Sub InitializeStatusBar()

    With Me.ultraStatusBar1

        ' Note: Under windows XP if the 'SupportThemes' property
        ' is left is True (its default setting) then some of
        ' the explicit appearance, border style and button
        ' style properties are ignored.
        .SupportThemes = False

        ' Set the border style for the status bar control
        .BorderStyle = UIElementBorderStyle.InsetSoft

        ' Set the default border style for panels
        .BorderStylePanel = UIElementBorderStyle.InsetSoft

        ' Set the style for button type panels
        .ButtonStyle = UIElementButtonStyle.PopupSoftBorderless

        ' Set the # of pixels between panels 
        .InterPanelSpacing = 3

        ' Specify the margins inside the status bar control.			
        .Padding = New UIElementMargins(2, 1, 1, 2)

        ' Set some apperance setting for the control
        .Appearance.BackGradientStyle = GradientStyle.VerticalBump
        .Appearance.BackColor = Color.Blue
        .Appearance.BackColor2 = Color.Aqua

        ' Set the default appearance for panels
        .PanelAppearance.BackColor = Color.Transparent

        ' Set some additional properties on the control
        .PanelsVisible = True
        .ResizeStyle = ResizeStyle.Immediate
        .ScaledImageSize = New Size(8, 8)
        .ScaleImages = ScaleImage.OnlyWhenNeeded
        .ShowToolTips = True
        .SizeGripVisible = DefaultableBoolean.True
        .UseMnemonic = True
        .WrapText = True

    End With

    ' Add some panels to the collection
    Dim panel As UltraStatusPanel

    ' Add a simple text panel 
    panel = Me.ultraStatusBar1.Panels.Add("P1", PanelStyle.Text)
    panel.Text = "some text"

    ' Add an auto status text style panel.

    ' Note: At design time a 'StatusBarText' extender property
    ' is added to each control and menu on the form. 
    ' At runtime, when the mouse is over the control the text 
    ' specified for this property will display in the AutoStatusText
    ' panel.
    ' Also a panel of this type will automatically show the
    ' tooltip for tools on an UltraToolbarsManager toolbar or menu.

    panel = Me.ultraStatusBar1.Panels.Add("P2", PanelStyle.AutoStatusText)
    panel.SizingMode = PanelSizingMode.Spring

    ' You can also set the 'StatusBarText' extender property in 
    ' code by calling the 'SetStatusBarText' method as illustrated below.
    Me.ultraStatusBar1.SetStatusBarText(Me.button1, "Btn 1 action desc...")
    Me.ultraStatusBar1.SetStatusBarText(Me.button2, "Btn 2 action desc...")

    ' Add a character position style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P3", PanelStyle.CharacterPosition)
    panel.Control = Me.richTextBox1
    panel.CharacterPositionFormat = "Ln: [Line], Char: [Char]"
    panel.SizingMode = PanelSizingMode.Fixed
    panel.BorderStyle = UIElementBorderStyle.None
    panel.Width = 100

    ' Add a cursor position style panel
    panel = Me.ultraStatusBar1.Panels.Add("P4", PanelStyle.CursorPosition)
    ' You must specify either the form or a control so that
    ' when the mouse is moved over that control the panel
    ' will be automatically updated.
    panel.Control = Me.richTextBox1
    panel.CursorPositionFormat = "x: [X], y: [Y]"
    panel.SizingMode = PanelSizingMode.Automatic

    ' Add a button style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P5", PanelStyle.Button)
    panel.Text = "&End"
    panel.Appearance.TextHAlign = HAlign.Center
    panel.ToolTipText = "Scrolls to the end of the document"
    panel.Enabled = True

    ' Add a state button style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P6", PanelStyle.StateButton)
    panel.Text = "&Hex"
    panel.Checked = True

    ' Add a control container style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P7", PanelStyle.ControlContainer)
    panel.SizingMode = PanelSizingMode.Adjustable
    panel.MinWidth = 50
    panel.Control = Me.textBox1
    panel.Padding = New Size(3, 6)

    ' Add a date style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P8", PanelStyle.Date)
    panel.DateTimeFormat = "MMM-dd-yyyy"

    ' Add a time style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P9", PanelStyle.Time)
    panel.DateTimeFormat = "hh:mm:ss tt"

    ' Add a key state style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P10", PanelStyle.KeyState)
    panel.KeyStateInfo.DisplayStyle = KeyStateDisplayStyle.ChangeText
    panel.KeyStateInfo.Key = KeyState.InsertMode
    panel.KeyStateInfo.OffText = "Ovr"
    panel.KeyStateInfo.OnText = "Insrt"

    ' Add a marquee style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P11", PanelStyle.Marquee)
    panel.Text = "marquee string"
    panel.MarqueeInfo.Delay = 50
    panel.MarqueeInfo.MarqueeStyle = MarqueeStyle.Bouncing
    panel.MarqueeInfo.MarqueeDirection = Direction.LeftToRight
    panel.MarqueeInfo.MarqueeScrollAmount = 2
    panel.MarqueeInfo.Start()

    ' Add a progress style panel 
    panel = Me.ultraStatusBar1.Panels.Add("P12", PanelStyle.Progress)

    With panel.ProgressBarInfo

        .Appearance.ForeColor = Color.Red
        .FillAppearance.BackColor = Color.Blue
        .FillAppearance.ForeColor = Color.Yellow
        .Minimum = 25
        .Maximum = 85
        .Value = 50
        .ShowLabel = True
        .Style = ProgressBarStyle.SegmentedPartial
        .PercentFormat = "P2"
        .Label = _
                "Done: " + _
                UltraProgressBar.LABEL_FORMATTED + _
                "Remaining: " + _
                UltraProgressBar.LABEL_FORMATTED_REMAINING
    End With

    ' There is also an 'MDIList' style tool for use
    ' on MDI parent forms.

End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinStatusBar;
using Infragistics.Win.UltraWinProgressBar;

private void InitializeStatusBar()
{

	// Note: Under windows XP if the 'SupportThemes' property
	// is left is True (its default setting) then some of
	// the explicit appearance, border style and button
	// style properties are ignored.
	this.ultraStatusBar1.SupportThemes = false;
	
	// Set the border style for the status bar control
	this.ultraStatusBar1.BorderStyle = UIElementBorderStyle.InsetSoft;
	
	// Set the default border style for panels
	this.ultraStatusBar1.BorderStylePanel = UIElementBorderStyle.InsetSoft;
	
	// Set the style for button type panels
	this.ultraStatusBar1.ButtonStyle = UIElementButtonStyle.PopupSoftBorderless;
	
	// Set the # of pixels between panels 
	this.ultraStatusBar1.InterPanelSpacing = 3;
	
	// Specify the margins inside the status bar control.			
	this.ultraStatusBar1.Padding = new UIElementMargins(2, 1,1,2);

	// Set some apperance setting for the control
	this.ultraStatusBar1.Appearance.BackGradientStyle = GradientStyle.VerticalBump;
	this.ultraStatusBar1.Appearance.BackColor = Color.Blue;
	this.ultraStatusBar1.Appearance.BackColor2 = Color.Aqua;

	// Set the default appearance for panels
	this.ultraStatusBar1.PanelAppearance.BackColor = Color.Transparent;

	// Set some additional properties on the control
	this.ultraStatusBar1.PanelsVisible = true;
	this.ultraStatusBar1.ResizeStyle = ResizeStyle.Immediate;
	this.ultraStatusBar1.ScaledImageSize = new Size(8,8);
	this.ultraStatusBar1.ScaleImages = ScaleImage.OnlyWhenNeeded;
	this.ultraStatusBar1.ShowToolTips = true;
	this.ultraStatusBar1.SizeGripVisible = DefaultableBoolean.True;
	this.ultraStatusBar1.UseMnemonic = true;
	this.ultraStatusBar1.WrapText = true;

	// Add some panels to the collection
	UltraStatusPanel panel;

	// Add a simple text panel 
	panel = this.ultraStatusBar1.Panels.Add("P1", PanelStyle.Text );
	panel.Text = "some text";

	// Add an auto status text style panel.

	// Note: At design time a 'StatusBarText' extender property
	// is added to each control and menu on the form. 
	// At runtime, when the mouse is over the control the text 
	// specified for this property will display in the AutoStatusText
	// panel.
	// Also a panel of this type will automatically show the
	// tooltip for tools on an UltraToolbarsManager toolbar or menu.
	
	panel = this.ultraStatusBar1.Panels.Add("P2", PanelStyle.AutoStatusText );
	panel.SizingMode = PanelSizingMode.Spring;
	
	// You can also set the 'StatusBarText' extender property in 
	// code by calling the 'SetStatusBarText' method as illustrated below.
	this.ultraStatusBar1.SetStatusBarText( this.button1, "Btn 1 action desc...");
	this.ultraStatusBar1.SetStatusBarText( this.button2, "Btn 2 action desc...");

	// Add a character position style panel 
	panel = this.ultraStatusBar1.Panels.Add("P3", PanelStyle.CharacterPosition );
	panel.Control = this.richTextBox1;
	panel.CharacterPositionFormat =  "Ln: [Line], Char: [Char]";
	panel.SizingMode = PanelSizingMode.Fixed;
	panel.BorderStyle = UIElementBorderStyle.None;
	panel.Width = 100;

	// Add a cursor position style panel
	panel = this.ultraStatusBar1.Panels.Add("P4", PanelStyle.CursorPosition );
	// You must specify either the form or a control so that
	// when the mouse is moved over that control the panel
	// will be automatically updated.
	panel.Control = this.richTextBox1;	
	panel.CursorPositionFormat =  "x: [X], y: [Y]";
	panel.SizingMode = PanelSizingMode.Automatic;

	// Add a button style panel 
	panel = this.ultraStatusBar1.Panels.Add("P5", PanelStyle.Button );
	panel.Text = "&End";
	panel.Appearance.TextHAlign = HAlign.Center;
	panel.ToolTipText = "Scrolls to the end of the document";
	panel.Enabled = true;

	// Add a state button style panel 
	panel = this.ultraStatusBar1.Panels.Add("P6", PanelStyle.StateButton );
	panel.Text = "&Hex";
	panel.Checked = true;

	// Add a control container style panel 
	panel = this.ultraStatusBar1.Panels.Add("P7", PanelStyle.ControlContainer );
	panel.SizingMode = PanelSizingMode.Adjustable;
	panel.MinWidth = 50;
	panel.Control = this.textBox1;
	panel.Padding = new Size(3,6);

	// Add a date style panel 
	panel = this.ultraStatusBar1.Panels.Add("P8", PanelStyle.Date );
	panel.DateTimeFormat = "MMM-dd-yyyy";

	// Add a time style panel 
	panel = this.ultraStatusBar1.Panels.Add("P9", PanelStyle.Time );
	panel.DateTimeFormat = "hh:mm:ss tt";

	// Add a key state style panel 
	panel = this.ultraStatusBar1.Panels.Add("P10", PanelStyle.KeyState );
	panel.KeyStateInfo.DisplayStyle = KeyStateDisplayStyle.ChangeText;
	panel.KeyStateInfo.Key = KeyState.InsertMode;
	panel.KeyStateInfo.OffText = "Ovr";
	panel.KeyStateInfo.OnText = "Insrt";

	// Add a marquee style panel 
	panel = this.ultraStatusBar1.Panels.Add("P11", PanelStyle.Marquee );
	panel.Text = "some marquee string";
	panel.MarqueeInfo.Delay = 50;
	panel.MarqueeInfo.MarqueeStyle = MarqueeStyle.Bouncing;
	panel.MarqueeInfo.MarqueeDirection = Direction.LeftToRight;
	panel.MarqueeInfo.MarqueeScrollAmount = 2;
	panel.MarqueeInfo.Start();

	// Add a progress style panel 
	panel = this.ultraStatusBar1.Panels.Add("P12", PanelStyle.Progress );
	ProgressBarInfo pbi = panel.ProgressBarInfo;
	pbi.Appearance.ForeColor = Color.Red;
	pbi.FillAppearance.BackColor = Color.Blue;
	pbi.FillAppearance.ForeColor = Color.Yellow;
	pbi.Minimum = 0;
	pbi.Maximum = 100;
	pbi.ShowLabel = true;
	pbi.Style = ProgressBarStyle.SegmentedPartial;
	pbi.PercentFormat = "P2";

	// Note: There are 10 different substitution string
	// constants defined by UltraProgressBar that are
	// prefixed by "LABEL_". The actual values are then
	// substituted for these constants to format the
	// label that is displayed in the panel.
	
	pbi.Label = "Done: " +
				UltraProgressBar.LABEL_FORMATTED +
				"Remaining: " + 
				UltraProgressBar.LABEL_FORMATTED_REMAINING );
	
	pbi.Value = 50;

	// There is also an 'MDIList' style tool for use
	// on MDI parent forms.

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also