如何检测WinForms Panel是否滚动到末尾? [英] How to detect if WinForms Panel has scrolled to the end?

查看:98
本文介绍了如何检测WinForms Panel是否滚动到末尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个WinForms应用程序,其中有一个包含一些用户控件的面板.当面板第一次加载时,它会显示10个用户控件.但是,当它完全向下滚动时,它应该加载并在面板末尾附加更多用户控件.我正在尝试使用以下代码实现这一目标:

I am developing a WinForms application in which there is a panel which contains some user-controls. When the panel loads for the first time it shows 10 user controls. But when it is scrolled down completely it should load and append more user controls at the end of the panel. I am trying to achieve this using this code:

private void topicContainer_Scroll(object sender, ScrollEventArgs e)
{
      if (e.NewValue== topicContainer.VerticalScroll.Value)
                MessageBox.Show("Topics load here");
}

这只是一个试用.我不知道这个NewValue实际上意味着什么.那么,能否请您告诉我如何完成此任务?

Its just a trial. I don't know what actually this NewValue means. So, can you please tell how to accomplish my this task?

推荐答案

MSDN很好地介绍了这种情况.你检查了吗?

MSDN covers the case quite nicely. Have you checked it out?

  • ScrollableControl.Scroll
  • ScrollEventHandler
  • ScrollEventArgs

请记住滚动条的怪异行为:用户永远无法达到其Maximum值.阅读 ScrollBar.Maximum 中的备注. MSDN帮助页面.

Remember though about the weird behavior of scrollbars: user is never able to reach its Maximum value. Read remarks in the ScrollBar.Maximum MSDN help page.

这篇关于如何检测WinForms Panel是否滚动到末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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