XeZrunner
XeZrunner

Reputation: 245

Change label text (characters) with a timer in a way to create animation?

There's a font that has a Windows 8 style progressring in itself as characters. However, there's too many of them and programming them one by each would take forever. Is there a way I could get a label to change it's text to those characters using a timer, but without having to program each character one by one? (The font is used in both the Windows boot screen, and the Windows 8-10 Media Creation Tool to display the progressring, I would imagine there's a way to do this in C# WinForms as well.)

Here's the font file opened in charmap:

The font with the progressring in charmap

Upvotes: 1

Views: 745

Answers (1)

XeZrunner
XeZrunner

Reputation: 245

In the end, this worked: (this is for the Setup font file, if you are using the C:\Windows\Boot\Fonts\segoe_slboot.ttf font file, look in charmap for the character code points)

char code = "\ue052"[0]; // U+E052 is the first character of the progressring

public Application()
        {
            InitializeComponent();

            progressringLabel.Text = code;
        }

private void progressringTimer_Tick(object sender, EventArgs e)
        {
            code++;
            progressring.Text = code.ToString();
            if (code == "\ue0CB"[0])
            {
                code = "\ue052"[0]; // When the code ends up being the last progressring character, revert back to the first one so that it won't go into the other characters
            }
        }

Upvotes: 1

Related Questions