I have a Background Worker doing some work, when the code starts processing the next file I have it show the name in a StatusStripLabel on the StatusStrip. This works fine, I don't need to check if an Invoke is required or anything (The control actually doesn't have the Invoke stuff in it like labels, forms, textboxes do)
Out of the blue when the background worker was running, I minimized the window. When I resorted the window half a minute later, the application crashed and gave me a 'Cross thread violation' exception. Now my question is: How do I use a delegate sub to check if an Invoke is required on a control that is thread safe, but will still throw a cross thread error?
Or, is it thread safe to check Me.WindowState without invoking it before assigning a value to the text property of the StatusStripLabel?
Thoughts? Opinions?
Out of the blue when the background worker was running, I minimized the window. When I resorted the window half a minute later, the application crashed and gave me a 'Cross thread violation' exception. Now my question is: How do I use a delegate sub to check if an Invoke is required on a control that is thread safe, but will still throw a cross thread error?
Or, is it thread safe to check Me.WindowState without invoking it before assigning a value to the text property of the StatusStripLabel?
Thoughts? Opinions?