问题描述
你好。
当我运行我的程序时,我的消息框永远出现。
我想要弹出消息然后< g class =" gr_ gr_353 gr-alert gr_gramm gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep"数据-GR-ID =" 353" ID = QUOT; 353">用户< / g取代;将关闭它。
When I run my program my message box comes up forever.
I want the message to pop up then <g class="gr_ gr_353 gr-alert gr_gramm gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="353" id="353">user</g> will close it.
我的代码:
(之前的代码)
&NBSP; &NBSP; &NBSP; &NBSP; &NBSP; if(progressBar1.Value == progressBar1.Maximum)
&NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; MessageBox.Show(" Done!");
&NBSP; &NBSP; &NBSP; }¥b $ b &NBSP; }
}
(code before)
if (progressBar1.Value == progressBar1.Maximum)
MessageBox.Show("Done!");
}
}
}
推荐答案
private async void button1_Click(object sender, EventArgs e)
{
progressBar1.Value = 0;
var progress = new Progress<int>(percent =>
{
progressBar1.PerformStep();
if (percent == progressBar1.Maximum)
{
MessageBox.Show("Finished");
}
});
await Task.Run(() => Processing(progress));
}
这篇关于进度条完成后的消息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!