-1
我有一个WinForms程序,该程序在该statusStrip
中有button
,statusStrip
和toolStripStatusLabel
。如果我按一下按钮,这样运行:立即更新toolStripStatusLabel
private void button1_Click(object sender, EventArgs e)
{
toolStripStatusLabel1.Text = "Test";
System.Threading.Thread.Sleep(5000);
}
然后toolStripStatusLabel
的文本不更新后才线程完成睡觉。我如何让它立即更新,然后睡觉线程?
使用'toolStripStatusLabel1.Update()'睡眠之前。 –
@ P.Kouvarakis我在https://msdn.microsoft.com/zh-cn/library/system.windows.forms.toolstripstatuslabel(v=vs.110).aspx – derekantrican
中看不到任何此类方法对不起,您是正确的.'ToolStripStatusLabel'不是'Control'。您必须在工具栏本身调用'Update()'('statusStrip'?)。 –