WinForms 工具提示项目尺寸适合

发布于 2024-10-04 00:42:05 字数 164 浏览 1 评论 0原文

我正在使用 Toolstrip 为自己绘制一个 TabStrip,我不希望项目溢出,而是缩小以适应可用宽度。非常类似于许多浏览器选项卡的行为(例如 Chrome)。

我知道有一个可以覆盖的 LayoutEngine 属性,但我不知道如何实现它。

有人知道如何使物品适合工具条宽度吗?

I am using a Toolstrip to draw myself a TabStrip where I do not want the items to overflow, but rather shrink-to-fit the available width. Very much like many browsers tabs behave (ex. Chrome).

I know there is a LayoutEngine property which can be overriden, but I have no clue on how to implement this.

Anyone knows how to make the items fit the toolstrips width?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尘世孤行 2024-10-11 00:42:05

Infragistics .NetAdvantage WinToolbars 控件将执行此操作。这是一种商业产品,但购买控件可能比自己构建控件更便宜。

The Infragistics .NetAdvantage WinToolbars controls will do this. This is a commercial product, but it may be cheaper to buy a control than build one yourself.

蓝颜夕 2024-10-11 00:42:05

看一下这个相关问题:

How to make a ToolStripComboBox to fill all the available space on a ToolStrip?

我更喜欢 Martin 的答案,因为它没有任何神奇的硬编码数字。虽然如果您要缩小多个项目,您仍然需要进行一些算术运算,但我确信相同的方法也适用。

Have a look at this related question:

How to make a ToolStripComboBox to fill all the space available on a ToolStrip?

I prefer Martin's answer because it doesn't have any magic hard-coded numbers in it. While you'll still have to do a bit of arithmetic if you are making multiple items shrink-to-fit, I'm sure the same method would be applicable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文