0
所以,現在我有標籤左側。不過,我希望我的屏幕頂部有標籤,因爲這些是我想要實現的不同控件。我試着在我的網格中添加另一個tabcontrol,但佈局完全搞砸了,沒有任何標籤工作了。wpf如何添加多個tabcontrols到一個窗口
任何解決方案?
<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>
你可以創建你想達到什麼草圖? (ProTip - 轉到[ux.stackexchange]並使用內置於詢問/回答中的工具)。 – ChrisF
多個選項卡控件工作得很好。你做了什麼沒有奏效? –