Winforms 工具栏的按钮换行。
我动态地向工具栏添加了一堆按钮。 如果按钮数量超过当前表单中的水平空间,我希望能够以编程方式将其换行到第二行。 我不希望用户必须单击下拉按钮才能查看更多按钮,因为我需要确保所有按钮始终可见。
对于如何做到这一点有什么建议吗?
I am dynamically added a bunch of buttons to a toolbar. I want the ability to programatically make it wrap onto a second row if the number of buttons exceeds the horizontal space in the current form. I dont want users to have to click the dropdown button to view more buttons as i need to ensure that all buttons are viewable always.
are there any suggestions for how to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你只需要四行。 首先,禁用停靠:
然后关闭自动调整大小:
现在将布局设置为“Flow”
然后将大小更改为普通 ToolStrip 高度的两倍,或任何您想要的。
You need just four lines. First, disable docking:
Then turn off auto-sizing:
Now set the layout to "Flow"
Then then change the size to double the height of a normal ToolStrip, or whatever you want.