WPF Stackpanel 添加滚动条

<ScrollViewer x:Name="scrolls" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Height="300">
            <ScrollViewer.Content>
                <StackPanel x:Name="numberedItemsStackPanel" Orientation="Horizontal"   ScrollViewer.VerticalScrollBarVisibility="Auto">
                    …………………………………………
                </StackPanel>
            </ScrollViewer.Content>
</ScrollViewer>

属性:Orientation决定显示方向(水平或垂直).

 

 

你可能感兴趣的:(WPF)