|
-
Nov 30th, 2008, 03:51 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2008] HScroll Bar problem
If I have the following code:
HTML Code:
Private Sub hsb_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles hsb.Scroll
lblhsbValue.Text = hsb.Value
End Sub
and the properties are set to the default (Min is 0, max is 100, value is 0, Minjump is 1, maxjump is 10, etc etc), why is it that the label only shows the scroll bar's value to be 91 when the scroll bar is all the way to the right? Even if I click the > arrow button on the scroll bar, it stays at 91 as if 91 is it's max. Is there any reason for this, or a way to fix it?
Last edited by Slyke; Nov 30th, 2008 at 06:04 AM.
-
Nov 30th, 2008, 05:04 AM
#2
Re: [2008] HScroll Bar problem
When the scroll bar is all the way to the right the Value will be equal to:
Maximum - LargeChange + 1
If you want the Value to equal the Maximum then you'd need to make the LargeChange equal to 1. If you don;t want the LargeChange to be 1 but you want the Value to be 100 when the scroll bar is all the way to the right then you must set the Maximum to:
Value + LargeChange - 1
If your maximum Value will be 100 and the LargeChange is the default 10 then that means your Maximum would need to be 109.
-
Nov 30th, 2008, 06:03 AM
#3
Thread Starter
Fanatic Member
Re: [2008] HScroll Bar problem
Yep, that fixes it.
I thought that because it only changes by 1 when I clicked the > button, that it could go past 91 since it would go to 92, which is still less then 100, but just have to live with it .
Thanks for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|