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