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 TabControl
s. 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
精彩评论