为什么在 C# 中更改滚动条的 LargeChange 值会破坏它?
这对我来说真的没有意义。如果 LargeChange 设置为 1,我的滚动条可以正常工作,但如果我将其设置为 10,它就不会一直滚动。如果我将其设置为 100,我将无法进一步滚动。对于所有这些示例,SmallChange 均设置为 1。
我想可能会发生的情况是,例如,如果 LargeChange 为 10,最大值为 100,如果值是 95,那么您根本无法滚动,但即使在该值下,我也根本无法进行小的更改。这对我来说没有任何意义。有人可以解释一下吗?
This doesn't really make sense to me. My scroll bar works perfectly if LargeChange is set to 1 but if I set it to 10 it doesn't scroll all the way. If I set it to 100 I can't scroll even further. SmallChange is set to 1 for all of these examples.
I guess what could be happening maybe is that if LargeChange is 10 and the Maximum is 100, for example and if the Value is 95 then you would not be able to scroll at all but even at that value I cannot do a small change at all. This doesn't make any sense to me. Can someone explain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我明白你在问什么,但根据 http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollbar.largechange.aspx 这两个值 SmallChange 和 LargeChange 都“相对”于滚动条最大值...
您在哪个滚动条上看到这个?图片框?
编辑 - 根据评论:
如果我正确理解你,你将需要类似的东西 http://www.codeproject.com/KB/miscctrl/understandingScrollbars.aspx 使其正常工作...
要记住的另一点:
用户界面指南建议SmallChange 和 LargeChange 属性是相对于用户看到的视图的大小设置的,而不是相对于总大小(包括不可见的部分)。例如,如果您有一个带有滚动条的图片框,显示大图像,则 SmallChange 和 LargeChange 属性应相对于图片框的大小而不是图像的大小进行设置。
请参阅 http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollbar%28v=VS.100%29.aspx
I am not sure I understand what you are asking but according to http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollbar.largechange.aspx both values SmallChange and LargeChange are "relative" to the scrollbar maximum...
On what scrollbar are you seeing this ? PictureBox ?
EDIT - as per comment:
IF I understand you correctly you will need to something similar to this http://www.codeproject.com/KB/miscctrl/understandingScrollbars.aspx to make it work...
Another point to keep in mind:
User interface guidelines suggest that the SmallChange and LargeChange properties are set relative to the size of the view that the user sees, not to the total size including the unseen part. For example, if you have a picture box with scroll bars displaying a large image, the SmallChange and LargeChange properties should be set relative to the size of the picture box, not to the size of the image.
see http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollbar%28v=VS.100%29.aspx