【问题标题】:Enabling Scrollbar in WPF在 WPF 中启用滚动条
【发布时间】:2009-04-09 22:49:55
【问题描述】:

我现在遇到一个问题,当窗口垂直过小时,我的 WPF 应用程序会隐藏折叠下方的任何内容。如何使用 XAML 为整个应用显示垂直滚动条,以便用户可以滚动查看其余内容?

【问题讨论】:

    标签: wpf xaml wpf-controls


    【解决方案1】:

    在 Window 中放置一个 ScrollViewer:

    <Window x:Class="WpfApplication2.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300">
    
        <ScrollViewer >
            <!-- Window content here -->
        </ScrollViewer>
    </Window>
    

    【讨论】:

    • 当我输入ScrollViewer 时,滚动条出现,在我的情况下,是一个垂直的,因为我使用动画将项目向下移动,并且当它到达窗口滚动条的底部时显示,但我无法看到滚动条光标或通过鼠标滚动。
    猜你喜欢
    • 1970-01-01
    • 2010-10-14
    • 1970-01-01
    • 1970-01-01
    • 2011-05-18
    • 2014-04-07
    • 2011-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多