Toolstripstatuslabel not updating

Toolstripstatuslabel not updating

This class has

So I basically loop through all the open forms to find the reference to the active MdiParent instance which then gets passed back to the caller. Unfortunately, ToolStripStatusLabel doesn't have such a method. This application uses a thread that waits to send either one event or the other when a button is pressed. The usual way to deal with this is to use the Invoke method of the control to delegate the operation so that it is thread-safe. This basically can happen when you fire an event from an independent thread method and want to display a message in the client application.

The trick is to get the Parent of the ToolStrip item and call the Invoke method with the delegate to set the Text property. Once a order is complete, I use a thread to email the order to the supplier.

In the thread I then use the following code. However, this solution works.

In the thread I

The code of this solution is given below. So, I searched by myself for a solution thinking that Microsoft had surely thought about this.

Points of interest

The solution is in the StatusStrip control that contains all of the ToolStrip controls. The event handlers display a message in the status bar using one of the two methods described previously.

This class has the InvokeRequired and Invoke methods that are necessary to delegate the call on the right thread. The code to achieve this is given below. Points of interest This code can be used for any ToolStrip control that you might use in a StatusStrip container.

However this solution worksThe code to achieve this is