Get scroll Position Percentage

我与影子孤独终老i 提交于 2019-12-07 02:27:20

问题


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.


回答1:


On Panel's Scroll Event, you can do

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

if (scrollPercentage > 0.6)
{
    ...
}


来源:https://stackoverflow.com/questions/7155389/get-scroll-position-percentage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!