重新调整选项卡面板内项目的大小(选项卡控件)
我想将选项卡标题设置为完全适合控件内选项卡的数量,
因此如果我有 1 个选项卡项,它将扩展到控件的整个宽度; 如果我有 2 个选项卡项目,每个选项卡项目都设置为控件的一半宽度; 3 个选项卡项目.....1/3.....等等。
知道怎么做吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Width 绑定到
TabControl.ActualWidth
和TabControl.Items.Count
。 microsoft.com/en-us/library/system.windows.data.multibinding.aspx" rel="nofollow">MultiBinding
并添加转换器
为计算适当的分数。You can bind the
Width
to theTabControl.ActualWidth
andTabControl.Items.Count
using aMultiBinding
and add aConverter
to calculate the appropriate fraction.