当我的控件的大小小于listbox时,verticalscrollviewer会自动启用。
<ListBox Name="listBox" ItemsSource="{Binding DropPlaces}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel FlowDirection="LeftToRight" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
...
</ListBox.ItemTemplate>
</ListBox>
答案 0 :(得分:0)
尝试将ScrollViewer.VerticalScrollBarVisibility
设置为auto
http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollbarvisibility(v=vs.110).aspx
答案 1 :(得分:0)
尝试设置两个值:
VerticalContentAlignment="Stretch"
ScrollViewer.VerticalScrollBarVisibility="Disabled"