以创建动画的方式使用计时器更改标签文本(字符)?
Change label text (characters) with a timer in a way to create animation?
有一种字体本身具有 Windows 8 样式的进度条作为字符。然而,它们太多了,一个一个地编程将需要很长时间。有没有一种方法可以让我使用计时器将标签的文本更改为那些字符,而不必一个一个地对每个字符进行编程? (该字体用于 Windows 启动屏幕和 Windows 8-10 媒体创建工具以显示进度条,我想在 C# WinForms 中也有一种方法可以做到这一点。)
这是在 charmap 中打开的字体文件:
最后,这成功了:(这是用于安装字体文件,如果您使用的是 C:\Windows\Boot\Fonts\segoe_slboot.ttf 字体文件,请在 charmap 中查找字符代码点)
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
}
}
有一种字体本身具有 Windows 8 样式的进度条作为字符。然而,它们太多了,一个一个地编程将需要很长时间。有没有一种方法可以让我使用计时器将标签的文本更改为那些字符,而不必一个一个地对每个字符进行编程? (该字体用于 Windows 启动屏幕和 Windows 8-10 媒体创建工具以显示进度条,我想在 C# WinForms 中也有一种方法可以做到这一点。)
这是在 charmap 中打开的字体文件:
最后,这成功了:(这是用于安装字体文件,如果您使用的是 C:\Windows\Boot\Fonts\segoe_slboot.ttf 字体文件,请在 charmap 中查找字符代码点)
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
}
}