[ Snippet ] Epicor Add ProgressBar to StatusBar

You can add a ProgressBar among many other things to the StatusBar.

// Usings
using Infragistics.Win;
using Infragistics.Win.UltraWinStatusBar;
using Infragistics.Win.UltraWinProgressBar;

public void CreateStatusBarPanels()
{
    UltraStatusBar ultraStatusBar1 = (UltraStatusBar)oTrans.StatusPanel.UltraStatusBar;
 
	// Disable Epicor Styles so we can show Color
    ultraStatusBar1.UseAppStyling = false;

    // Add Workstation ID to Panel or Just a Normal Text
    UltraStatusPanel panel = ultraStatusBar1.Panels.Add("PWID", PanelStyle.Text ); // PWID is just my Key Field for Panel
    //panel.Text = string.Format("{0} - {1}", ((Ice.Core.Session)(this.oTrans.Session)).WorkstationID, ((Ice.Core.Session)(this.oTrans.Session)).WorkstationDescription);
	panel.Text = "Greetings!";
    panel.SizingMode = PanelSizingMode.Automatic;
    panel.Visible = true;
 
    // Marquee Text
    if (ultraStatusBar1.Panels.Exists("P2") == false)
    {
        panel = ultraStatusBar1.Panels.Add("P2", PanelStyle.Marquee );
        panel.Text = "White";
        panel.Width = 80;
        panel.MarqueeInfo.Delay = 5;
        panel.MarqueeInfo.MarqueeStyle = MarqueeStyle.Bouncing;
        panel.MarqueeInfo.MarqueeDirection = Direction.LeftToRight;
        panel.MarqueeInfo.MarqueeScrollAmount = 2;
        panel.MarqueeInfo.Start();
 
        panel = ultraStatusBar1.Panels.Add("P3", PanelStyle.Marquee );
        panel.Text = "Dragon";
        panel.Width = 70;
        panel.MarqueeInfo.Delay = 30;
        panel.MarqueeInfo.MarqueeStyle = MarqueeStyle.Bouncing;
        panel.MarqueeInfo.MarqueeDirection = Direction.LeftToRight;
        panel.MarqueeInfo.MarqueeScrollAmount = 2;
        panel.MarqueeInfo.Start();
    }
 
    // Add Progress Bar
    panel = ultraStatusBar1.Panels.Add("Progress", PanelStyle.Progress );
    ProgressBarInfo pbi = panel.ProgressBarInfo;
    panel.Width = 250;
    pbi.Appearance.ForeColor = System.Drawing.Color.Red;
    pbi.FillAppearance.BackColor = System.Drawing.Color.Blue;
    pbi.FillAppearance.ForeColor = System.Drawing.Color.Yellow;
    pbi.Minimum = 0;
    pbi.Maximum = 100;
    pbi.ShowLabel = true;
    pbi.Style = Infragistics.Win.UltraWinProgressBar.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 = 35;
}

The P1, P2, PWID are just Panel Key’s you can give it any name you like. You can check if the Panel exists by using something like:

ultraStatusBar1.Panels.Exists("P2");

Edit Text

// Assuming you stored ultraStatusBar1 is global
// Check if Panel Exists ultraStatusBar1.Panels.Exists("MyPanelID");
this.ultraStatusBar1.Panels["MyPanelID"].Text = "Updating Text.....";

// Or use
((Infragistics.Win.UltraWinStatusBar.UltraStatusBar)oTrans.StatusPanel.UltraStatusBar).Panels["ID"].Text = "Hello";
8 Likes

@hkeric.wci

Well there goes my night, my holiday…Playing with all these things you post.

Thanks for the early Seasons greetings Haso.

I assume you would need to utilize some sort of threading to update the progress bar while things chug in the background?

Probably not to block the UI Thread, you can find additional Panel Styles at Documentation Archives | Infragistics

One I haven’t tried yet is this one:

The Notification Badges allow you to notify your users about every important event that requires their attention.

1 Like