最近写的一个WPF小程序,边学边做的,在动态添加控件时出的这个问题,试了一下,直接写xaml也有这个问题,所以可以简单的说明一下.
直接上xaml:
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<TabControl>
<TabItem Header="station1">
<StackPanel VerticalAlignment="Stretch">
<TabControl VerticalAlignment="Stretch">
<TabItem Header="output" VerticalAlignment="Stretch">
<TextBox VerticalAlignment="Stretch"