Sev*_*Sev 5 .net c# multithreading
我使用以下代码来调用我的应用程序中的主UI线程上的控件.我在Status Strip中的进度条没有InvokeRequired,我需要以某种方式调用System.Windows.Forms.ToolStripProgressBar.
if (txtbox1.InvokeRequired)
{
txtbox1.Invoke(new MethodInvoker(delegate { txtbox1.Text = string.Empty; }));
}
Run Code Online (Sandbox Code Playgroud)
尝试
if (toolStripProgressBar1.Parent.InvokeRequired)
{
toolStripProgressBar1.Parent.Invoke(new MethodInvoker(delegate { toolStripProgressBar1.Value= 100; }));
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
22155 次 |
最近记录: |