Sev Sev - 1 year ago 151
C# Question

How to Invoke the progress bar in Status strip?

I am using the following code to invoke the controls that are on the main UI thread in my application. The progress bar that I have in my Status Strip does not have a InvokeRequired, I need to somehow invoke the System.Windows.Forms.ToolStripProgressBar.

if (txtbox1.InvokeRequired)
txtbox1.Invoke(new MethodInvoker(delegate { txtbox1.Text = string.Empty; }));

Answer Source


if (toolStripProgressBar1.Parent.InvokeRequired)
    toolStripProgressBar1.Parent.Invoke(new MethodInvoker(delegate { toolStripProgressBar1.Value= 100; }));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download