滚动条问题

发布于 2024-08-19 09:32:45 字数 70 浏览 8 评论 0原文

我正在使用面板来显示文档。我想知道垂直滚动条何时到达两侧(最顶部位置 - 您不能再向上滚动。最底部位置 - 您不能再向下滚动)

I'm using a panel to display a document. I want to know when the vertical scroll bar has reached the either of the sides( the top-most position - where you cannot scroll up any more. and the bottom-most position - where you cannot scroll down any more)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

友谊不毕业 2024-08-26 09:32:45

如果您的滚动条小部件遵循您的代码来执行实际滚动(即滚动条仅处理其自己的位置和完成的百分比),在这种情况下您应该知道滚动何时达到最小值或最大值。

否则,几乎所有滚动条都需要保留最小值、最大值和当前值,以便能够重绘自身并处理滚动。根据 GUI 工具包的不同,访问这些值的方式也有所不同。例如,Win32 代码可以通过 SCROLLBARINFO 结构获取值,而 Qt 则提供minimum()、maximum() 和 value() 方法。
由于没有更多关于滚动条来自何处的信息,我们只能说这些。您可以自行搜索或在您的问题中添加更多信息,以便我们提供更好、更准确的信息。

If your scrollbar widget defers to your code in order to perform the actual scrolling (that is, the scrollbar handles only its own position and percentage done), in that case you should know when the scrolling reaches the minimum or maximum.

Otherwise, pretty much all scrollbars need keep minimum, maximum and current values in order to be able to redraw themselves and handle scrolling. Depending on the GUI toolkit, how you access these values varies. Win32 code can get the values through a SCROLLBARINFO struct while Qt offers minimum(), maximum() and value() methods for example.
Without more information on where your scrollbar comes from, that's all we can say. Either search for yourself or add more information to your question so we can provide better and more accurate information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文