Announcement
Collapse
No announcement yet.
X
-
No good reason except the ButtonItems were already there and I'm switching from using a form to a toolstrip. I've changed them to ToolStripButttons and, not only do they look better, the are left justified now.
-
Changing the layoutPolicy should correct this.
However, why are you using ButtonItems for this instead of the dedicated ToolStripButton class (which has a more ToolStrip-like appearance)?
Leave a comment:
-
-
You want setWidth100(), but you also want to change the horizontal layoutPolicy to "none" to prevent the ToolStrip from trying to widen controls to fill available space.
Leave a comment:
-
Adding fill to the right in a ToolStrip
I have a tool strip that contains a few controls, but not enough to fill all of the horizontal space available. I'd like the controls to be left justified in the strip and then have the strip background continue to the right to fill the remaining space.
I've tried ToolStrip.addFill() followed by ToolStrip.addFormItem(new SpacerItem()). That just results in a little extra background to the right, but it doesn't fill the available horizontal space. If I setWidth100() on the strip the controls are spaced out evenly to fill the available space, which is still not what I'm after.
How to I add a filler so that the controls remain left justified but the strip still fills 100% of the width.Tags: None
Leave a comment: