In my Winforms application I have a toolbar that contains many items (buttons with icon 32px, labels and comboboxes).
I decided to set the Toolstrip.LayoutStyle
property from the default HorizontalStackWithOverflow
to Flow
in order to allow the toolbar split automatically on more rows when user have a very low resolution monitor or he/she resize the window.
The prob开发者_运维问答lem is that all labels and comboboxes are aligned to the top of Toolstrip when I change the LayoutStyle
.
Does exist a property or any other workaround that allow me to center them vertically?
I think I see what you mean, the label isn't as tall as, say, a button. And it gets aligned improperly with LayoutStyle = Flow. Ugh. You can work around it by changing the Padding property of the label. To do this properly, you should however do this in the form's OnLoad() method override, the label will be taller when you run on a machine with a higher video DPI setting.
精彩评论