ToolStripProgressBar and InvokeRequired

T

TJO

Why is there no InvokeRequired property on the ToolStripProgressBar
that would enable cross thread manipulation?
 
M

Mehdi

Why is there no InvokeRequired property on the ToolStripProgressBar
that would enable cross thread manipulation?

Because InvokeRequired (as well as Invoke and BeginInvoke) are part of the
Control class and ToolStripProgressBar doesn't derive from the Control
class (it derives from the Component class instead).

You can however call ToolStripProgressBar's functions from another thread
than the UI thread by using the InvokeRequired property and the Invoke and
BeginInvoke functions of any other UI control (your form for example).
Since all the UI controls are created in the UI thread (unless you've done
otherwise but that would not be wise), it doesn't matter on which control
you are calling InvokeRequired, Invoke or BeginInvoke, the result will be
the same.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top