获取滚动位置百分比 [英] Get scroll Position Percentage

查看:88
本文介绍了获取滚动位置百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够确定用户何时滚动浏览了面板中60%的内容,而我并没有太多运气找到解决方案.

I need to be able to determine when the user has scrolled through 60% of the content in a panel and I'm not having much luck finding a solution for this.

预先感谢您的任何想法.

Thanks in advance for any ideas.

推荐答案

在面板上的

On Panel's Scroll Event, you can do

double scrollPercentage = (double) 
                scrollbar.VerticalScroll.Value / scrollBar.VerticalScroll.Maximum;

if (scrollPercentage > 0.6)
{
    ...
}

这篇关于获取滚动位置百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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