im using scrollbars in my form, i want to know what values i should keep for SmallChange and LargeChange to work it smooth.
Printable View
im using scrollbars in my form, i want to know what values i should keep for SmallChange and LargeChange to work it smooth.
That would depend on the size of your form and how much scrolling needs to be done.
How large is it?
i have a picturebox which will be scrolled, and picture box(S) height and width will be changed itself at run time
Through your code or the Form's Resize event?Quote:
Originally Posted by chunk
yes i have it on Resize event of Form
I like the page method: LargeChange = picHolder.Height. picHolder is the container with the image inside of it. Each largechange event moves the image a "page" at a time. SmallChange can be LargeChange\10 and if value = zero, then make it one. This way smallchange is 1/10th of large change. But by making smallchange > 1, user must use the thumb to scroll single lines of the image.
An option to allow finer control if smallchange>1, may be to check for mouse down on the change event & if, say the ctrl key was down, revert to single pixel movements? Just thinking out loud & would require some more thought.
i want my scrollbars to work as our Internet Explorer(S) explorer works with Small and Large change. what values i should set of them on design time
Honestly, I don't think there is a magic formula. Each app will have its own requirement - Word will move maybe paragraphs at a time while IE may move IEFrames at a time. I think this is a designer's choice -- your choice. Setting them at design time is not the best option in my opinion. Scrollbars should always be adjusted to what needs to be scrolled.
ok i will try your previous solution to set at Run time
i wrote this code. do you want me to make some changes in it?Code:Private Sub Form_Load()
Dim VSmallVal As Long, HSmallVal As Long
VScroll1.LargeChange = PicBox.Height
HScroll1.LargeChange = PicBox.Width
VSmallVal = VScroll1.LargeChange / 10
HSmallVal = HScroll1.LargeChange / 10
If VSmallVal = 0 Then
VScroll1.SmallChange = 1
Else
VScroll1.SmallChange = VSmallVal
End If
If HSmallVal = 0 Then
HScroll1.SmallChange = 1
Else
HScroll1.SmallChange = HSmallVal
End If
End Sub
Chunk, it looks good -- do what feels right. Is the scrolling now more agreeable? If you are happy with it, that's all that counts really. Play with a small 32x32 image and a larger one, say 512x512 or larger.
sure i will try it