1
<StackPanel Grid.Row="0" Height="Auto" Width="Auto">
    <Label Name="Label1" BorderThickness="2,2,2,2" BorderBrush="Gray" HorizontalContentAlignment="Center" Width="Auto" Height="28">Window1</Label>               
    <ListView BorderThickness="2,0,2,0" BorderBrush="Gray"Height="Auto" Width="Auto" />                                   
</StackPanel>

在上面的 XAML 中,我想ListViewStackPanel. 我想要.之后ListView的整个客户区。StackPanelLabel

我究竟做错了什么 ?

4

1 回答 1

3

为什么不改用 DockPanel

<DockPanel Grid.Row="0" Height="Auto" Width="Auto">
     <Label DockPanel.Dock="Left" Name="Label1" BorderThickness="2,2,2,2" BorderBrush="Gray"  HorizontalContentAlignment="Center" Width="Auto" Height="28">Window1</Label>               
     <ListView BorderThickness="2,0,2,0" BorderBrush="Gray" Height="Auto" Width="Auto" />
</DockPanel>
于 2009-11-23T09:48:17.080 回答