以编程方式滚动窗口移动窗口 [英] Programmatically scroll the windows mobile window

查看:89
本文介绍了以编程方式滚动窗口移动窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有上有许多控件(足以使滚动条可见)的形式。我如何可以通过编程控制滚动窗口?

I have a form that has a number of controls on it (enough that the scroll bar is visible). How can I programmatically control the scroll window?

我可以伪造它现在通过调用Form中的最后一个控件的。选择()的方法,但我真的希望能够滚动所有的方式向窗口的底部。

I can fake it now by calling the .Select() method on the last control in the Form, but I'd really like to be able to scroll all the way to the bottom of the window.

推荐答案

的形式所具有的AutoScrollPosition财产。您可以设置它像下面的例子:

The Form has an AutoScrollPosition property. You can set it like in the following example:

this.AutoScrollPosition = new Point(0, this.Height);

这将完全滚动的形式向底部。对于这个工作,虽然,你需要有Form.AutoScroll属性设置为True。将其设置为true,则表单显示滚动条。我不知道如何可以隐藏起来,但仍然得到使用AutoScrollPosition的好处。

This will scroll the form exactly to the bottom. For this to work though, you need to have the Form.AutoScroll property set to True. Setting this to True, makes the form show scroll bars. I am not sure how one could hide them but still get the benefit of using AutoScrollPosition.

这篇关于以编程方式滚动窗口移动窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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