重新调整选项卡面板内项目的大小(选项卡控件)

发布于 2024-12-18 17:59:52 字数 144 浏览 4 评论 0 原文

我想将选项卡标题设置为完全适合控件内选项卡的数量,

因此如果我有 1 个选项卡项,它将扩展到控件的整个宽度; 如果我有 2 个选项卡项目,每个选项卡项目都设置为控件的一半宽度; 3 个选项卡项目.....1/3.....等等。

知道怎么做吗?

I want to set my tab headers to fit exactly depending on the number of tabs inside my control

so if I have 1 tab item it will expand to the whole width of the control;
if I have 2 tab items each is set to half width of the control;
3 tab items.....1/3.....etc.

any idea how to do that?

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

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

发布评论

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

评论(1

孤城病女 2024-12-25 17:59:52

You can bind the Width to the TabControl.ActualWidth and TabControl.Items.Count using a MultiBinding and add a Converter to calculate the appropriate fraction.

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