.NET vScrollBar Questions
Can anyone tell me why the formula for the the actual maximum Value of a vSc开发者_如何学PythonrollBar control is Maximum + LargeStep -1?
Is there a way to configure the control so that the Value is 0 when the scroll bar is at the bottom of the screen?
LargeChange is the size of the button that slides in a vScrollBar. Since the top part of the slider cannot slide all the way to the bottom, the maximum change is the vScrollBar.Maximum minus the size of the slider, and the size of the slider is set to be equal to the LargeChange.
You can set the minumum to be zero (plus largeCharge plus 1) to get it the be zero at the bottom. However, the other values will be negative. Maybe a better way is to subtract the value from the maximum in the scroll event and assign that to a variable:
scrollValue = VScrollBar1.Maximum - VScrollBar1.Value - VScrollBar1.LargeChange + 1
You may want to add the LargeValue to the vScrollBar1.Maximum.
精彩评论