WPF-标签控件中的两行标签-标签环绕 [英] WPF - two rows of tabs in a tab control - tab wrap

查看:120
本文介绍了WPF-标签控件中的两行标签-标签环绕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF TabControl ,其中包含大量选项卡,它们在屏幕上以连续的行显示。这意味着用户需要横向滚动才能查看所有选项卡。

I have a WPF TabControl with a large number of tabs and they are presented in a sequential line all across the screen. Which means that a user needs to scroll sideways in order to view all the tabs.

是否可以创建两行选项卡或制作一长行选项卡包裹成两行或更多行?

Is there a way to create two rows of tabs or make the long row of tabs "wrap" into two or more rows?

推荐答案

包装是 TabControl s。您使用的任何 Style ControlTemplate 都会干扰吗?

Wrapping is the default behavior for TabControls. Any Style or ControlTemplate you're using that interferes with that?

以下代码:

<Window x:Class="WpfApplication1.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300" AllowsTransparency="True" WindowStyle="None">
    <Grid>
        <TabControl>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
            <TabItem Header="TabItem"/>
        </TabControl>
    </Grid>
</Window>

收益率


这篇关于WPF-标签控件中的两行标签-标签环绕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆