即使选项卡项为空,我也试图在调整大小时拉伸(stretch) wpf 选项卡控件内容以适合屏幕。似乎没有拉伸(stretch)属性?
最佳答案
我刚刚尝试了下面的代码,矩形似乎可以正确拉伸(stretch)。如果我从 TabItem 中删除 Border & Rectangle,TabControl 也会正确拉伸(stretch)。也许我不明白你所说的“空”是什么意思,但试一试。
<Grid>
<TabControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TabItem Header="Item 1" Name="tabItem1">
<Border Margin="5" BorderBrush="Red" BorderThickness="3">
<Rectangle Fill="Pink" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Border>
</TabItem>
</TabControl>
</Grid>
关于wpf - 拉伸(stretch) wpf 选项卡控件内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3750913/