自动滚屏面板底部 [英] autoscroll panel to bottom

查看:115
本文介绍了自动滚屏面板底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小组在我的WinForms和它,我加载一些用户控件。

i have a panel in my winforms and in it i load some usercontrols .

我想自动滚动到面板的底部(作为我的面板填充)每次一个新的用户控件添加。我怎么能这样做呢?

i would like to autoscroll to the bottom of the panel( as my panel fills ) everytime a new usercontrol is added . How can i do so ?

推荐答案

您可以做到这一点通过设置的 VerticalScroll 的小组,但我认为这将是更好地使用 ScrollControlIntoView 代替。

You can do that by setting the VerticalScroll of the Panel but I think it would be better to use ScrollControlIntoView instead.

private void panel1_ControlAdded(object sender, ControlEventArgs e)
{
    panel1.ScrollControlIntoView(e.Control);
}

祝你好运!

这篇关于自动滚屏面板底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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