开发者

WPF - two rows of tabs in a tab control - tab wrap

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 o开发者_开发百科f tabs "wrap" into two or more rows?


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

The following code:

<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>

yields

WPF - two rows of tabs in a tab control - tab wrap

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜