Anchor ToolStripProgressBar to right of StatusBar(StatusStrip)
There's a simple solution. Make one fake ToolStripStatusLabel, empty the .Text and set .Spring = true;
After that, add your ToolStripProgressBar. Make sure the order is label first, then progressbar.
- Set the StatusStrip, LayoutStyle property to HorizontalStackWithOverflow.
- Set the control Alignment to Right for the control you want to be to the right.
For all who may be interested.. Anchor property is available, although in Code only (not in designer) ...but in any case, it DOES NOT work.. I left a BUG in Connect and got the generic WillNotFix with the Message seeming to indicate they'll consider it only for a major revision.
For some reason the "Spring" property seems to be erratic.. In my ultra-simpistic examples it is working, but in some others where I do some custom painting (but in Child Forms in a MDIPArent, with the latter having ht eStatusBar) it is not. In those cases, there's still a simple workaround though - in the ReSize event of the MDIParent Form (that has the statusbar) change the size of the StatusLabel to make it bigger in the same proprtion as th width-change, so it pushes the ProgressBar to the right edge of the StatusBar