wpf如何将多个tabcontrols添加到一个窗口

时间:2016-08-15 19:29:49

标签: wpf tabcontrol

所以,现在我有左边的标签。但是,我想在屏幕顶部显示标签,因为这些是我想要实现的不同控件。我尝试在我的网格中添加另一个tabcontrol,但布局完全搞砸了,没有一个标签可以工作了。

任何解决方案?

<Window x:Class="Berichtensysteem.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Berichtensysteem"
        mc:Ignorable="d"
        Title="Mailclient" Height="auto" Width="auto"
        >

        <Grid Height="400" Width="600">

        <TabControl TabStripPlacement="Left" >
            <TabItem Header="Inbox" Height="30">
                <TabItem.Content>
                    <ListView  Name="inbox" BorderThickness="2">
                        <ListView.View >
                            <GridView>
                                <GridViewColumn Header="From" Width="70" DisplayMemberBinding="{Binding from}" />
                                <GridViewColumn Header="Subject" Width="120" DisplayMemberBinding="{Binding subject}" />
                                <GridViewColumn Header="Content" Width="150" DisplayMemberBinding="{Binding content}" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                </TabItem.Content>
            </TabItem>
            <TabItem Header="Verzonden items" Height="30">
                <TabItem.Content>
                    <ListView  Name="sentitems" BorderThickness="2">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="From" Width="70" DisplayMemberBinding="{Binding from}" />
                                <GridViewColumn Header="Subject" Width="120" DisplayMemberBinding="{Binding subject}" />
                                <GridViewColumn Header="Content" Width="150" DisplayMemberBinding="{Binding content}" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                </TabItem.Content>
            </TabItem>
            <TabItem Header="Verwijderde Items" Height="30"
                     >
                <TabItem.Content>
                    <ListView  Name="deleteditems" BorderThickness="2">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="From" Width="70" DisplayMemberBinding="{Binding from}" />
                                <GridViewColumn Header="Subject" Width="120" DisplayMemberBinding="{Binding subject}" />
                                <GridViewColumn Header="Content" Width="150" DisplayMemberBinding="{Binding content}" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                </TabItem.Content>
            </TabItem>
        </TabControl>
    </Grid>

</Window>

0 个答案:

没有答案