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 に答える