Hello William,
Hello Jared,
and Hello everybody,
Just wondering if you know this... Is there any benefit to using
this.Invoke (this referring to the containing form), or is it better
to use control.Invoke (where control is whatever windows control you
wish to manipulate, e.g., toolStripProgressBar.Invoke(...))?
It's better to call invoke on the object whose method you are calling. That
way invoke will take you to the owning thread for that object.
I'm asking about calling Invoke() method for ToolStripProgressBar
manipulation because:
1. ToolStripProgressBar has no Invoke() method (should I call Invoke()
method on Frame?).
2. ToolStripProgressBar has no InvokeRequired property (so I thought
yesterday: "maybe it is not required to call Invoke?" ).
3. When I manipulate on some TextBox from another thread (without
calling Invoke()) I have an exception (debug configuration), BUT when I
manipulate on some ToolStripProgressBar or ToolStripStatusLabel from
another thread I have NO exception (also in debug).
Is the Invoke() method really required for manipulation on
ToolStripProgressBar from another thread? I know that it is needed for
TextBox, Button, etc. but what about ToolStripProgressBar and
ToolStripStatusLabel? If "Yes, it is required to call Invoke() also for
ToolStripProgressBar" than which Invoke()? Frame.Invoke()?
Sorry for my redundant questions - I just worry You understand my
English.
Thanks,
Daniel Wojciechowski
new needer of .Net knowledge