14-选项卡控件的使用

选项卡控件

TabItem 里面 只能有一个控件

我们可以放置一个布局控件 然后再在布局控件里面添加其他的子控件

<Grid>
    <TabControl x:Name="tabControl">
        <TabItem Header="详情">
            <StackPanel>
                <Button>dd</Button>
                <Button>dd</Button>
                <Button>dd</Button>
                <Button>dd</Button>
            </StackPanel>
        </TabItem>
        <TabItem Header="评论" Margin="0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Rectangle Grid.Row="0"></Rectangle>
                <Rectangle Fill="Blue"  Grid.Row="1"></Rectangle>
            </Grid>
        </TabItem>
    </TabControl>
</Grid>Code language: HTML, XML (xml)

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注