我在一個ItemsControl周圍的wpf中有一個滾動條,它只在列表長度大於窗口大小時纔可見。但是,當它被隱藏時,滾動條應該是空白的空白區域。如何在wpf中不顯示滾動條時展開窗口內容?
我該如何刪除這個空間,然後「摺疊」滾動條?
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
VerticalContentAlignment="Top"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding Path=ContactGroups}"
Width="Auto"
MinWidth="231"
MinHeight="342"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
Height="Auto"
HorizontalContentAlignment="Left"
VerticalContentAlignment="Top"
HorizontalAlignment="Stretch">
<ItemsControl.ItemTemplate>
<DataTemplate>
<c:ContactGroupControl />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
無法重現。你可以張貼截圖嗎? – 2009-09-17 13:24:25