WPF 导航窗口滚动条
我在这里看到了一些询问 WPF 滚动条的帖子,答案通常是使用 ScrollViewer。问题是,我只能让它与静态大小的窗口一起工作。如果调整窗口大小,滚动查看器就会被切断。
我希望出现 NavigationWindow 滚动条,有什么提示吗?我正在编写一个需要在各种显示分辨率下工作的应用程序。
I have seen a few posts here that ask about WPF scrollbars and the answer is usually to use a ScrollViewer. The problem with this is, I can only get it to work with a statically sized window. If the window is resized, the scrollviewer gets cut off.
I would like for the NavigationWindow scrollbars to appear, any tips? I'm writing an application that needs to work on a variety of display resolutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,如果您设置 Page 控件的大小,则滚动查看器将不会随着窗口大小的调整而调整大小。如果您有以下代码,您的滚动查看器将无法正常工作:
如果您简单地省略页面高度和宽度属性,如下所示,它将正常工作:
最后的简单解决方案:)
It turns out that if you set the size of a Page control, then a scrollviewer will not resize with the window as it's resized. If you have the following code, your scrollviewers will not work right:
If you simply leave out the page height and width properties as follows, it will work fine:
Simple solution in the end :)