Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Knight Rider Progress Bar
posted

I want to do a Knight Rider progress bar, how is this accomplished with WinGuage?  I have one that looks like a Knight Rider but cannot get the code right to make the bar go back and forth.


Thanks for any assitance!!

Parents
No Data
Reply
  • 195
    Verified Answer
    posted

    Guess there were no ideas on this one, or no one reads this forum. :-)  This is how I accomplished it, but would like to know if this is the right way or perhaps if there is a better way to accomplish the same thing?

    private int counterVariable = 5;

    this.myLinearGauge = this.ugMain.Gauges[0] as LinearGauge;
    myLinearGauge.Scales[0].EndExtent = 10;
    myLinearGauge.Scales[0].StartExtent = 5;

    I put this inside the long running process, inside say a loop or whatever:

    myLinearGauge.Scales[0].EndExtent+=counterVariable;
    myLinearGauge.Scales[0].StartExtent+=counterVariable;

    if (myLinearGauge.Scales[0].EndExtent == 95 && counterVariable == 5)
    {
       counterVariable = -5;
    }
    else if (myLinearGauge.Scales[0].StartExtent == 5 && counterVariable == -5)
    {
       counterVariable = 5;
    }
Children