C# 进度条结束时调用文本框值
我是C#的新手。 只是做我的第一个项目。 这是我的密码。 我只想在进度条加载完毕后填充文本框。 但它现在不起作用了。 有人能告诉我我在做什么吗。 我的代码如下C# 进度条结束时调用文本框值,c#,visual-studio-2008,C#,Visual Studio 2008,我是C#的新手。 只是做我的第一个项目。 这是我的密码。 我只想在进度条加载完毕后填充文本框。 但它现在不起作用了。 有人能告诉我我在做什么吗。 我的代码如下 private void button1_Click(object sender, EventArgs e) { this.timer1.Start(); // int n = timer1.Interval; int m = progressBar1.Value;
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Start();
// int n = timer1.Interval;
int m = progressBar1.Value;
if(m==0)
{
textBox2.Text = "test";
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
this.progressBar1.Increment(1);
}
}
试试这个:
int progressVal=0;
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Start();
// int n = timer1.Interval;
}
private void timer1_Tick(object sender, EventArgs e)
{
this.progressBar1.Increment(1);
progressVal= progressBar1.Value;
if(progressVal==progressBar1.Maximum)
{
timer1.Stop();
textBox2.Text = "Loading done!";
}
}