【发布时间】:2012-12-13 18:00:41
【问题描述】:
我目前有一个开始播放wav文件的按钮对象,还有一个进度条和一个计时器,这些都是Visual Studio 2010中的工具箱对象。问题是,当我打开表单时,进度栏自动开始填充。我怎样才能让它只有在我点击按钮时才能启动?
这是我目前的代码:
private void playsong1_Click(object sender, EventArgs e)
{
SoundPlayer sndplayer = new SoundPlayer(Programming_assignment.Properties.Resources.Back_In_Black);
sndplayer.Play();
timer1.Enabled = true;
}
private void progressBar1_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value < 256)
{
progressBar1.Value++;
}
}
【问题讨论】:
-
也许你可以在这里查看“如何在 C# 中实现进度条?stackoverflow.com/questions/1259949/…”
标签: c# progress-bar