在 WPF 中启用滚动条 [英] Enabling Scrollbar in WPF

查看:37
本文介绍了在 WPF 中启用滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm having a problem right now where my WPF application hides anything below the fold when the window is too small vertically. How can I use XAML to get a vertical scrollbar to appear for the entire app so the user can scroll to see the rest of the content?

推荐答案

在窗口中放置一个 ScrollViewer:

Put a ScrollViewer inside your Window:

<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>

这篇关于在 WPF 中启用滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆