|
-
Feb 25th, 2011, 02:26 PM
#1
Thread Starter
Fanatic Member
wpf scrollbar step property
Hi all
this is my issue i have a scrollbar on a window in a vb.net wpf project the smallchange value is set to 0.5 and the largechange value is set to 10 the range is from 0 to 100 (i.e. percentages in 0.5% steps).
My problem is that if i drag the slider then i get a double precision value. How can i configure this scrollbar so it increases by 0.5% steps when i drag the slider?
I know i could do it by using mouse enter, mouse move and mouse leave events in code behind but is there a parameter i can set in xaml that creates the required effect? google suggested a smooth scrolling parameter but i was unable to find this in msdn
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-
Feb 26th, 2011, 11:28 AM
#2
Thread Starter
Fanatic Member
Re: wpf scrollbar step property
so i guess i need to create a flag when the leftmouse buton is pressed then track changes in mouse move and finally reset the flag when the left mouse button is released? i would have thought that there was a way to do this with xaml...
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-
Feb 26th, 2011, 12:33 PM
#3
Thread Starter
Fanatic Member
Re: wpf scrollbar step property
ok kind of resolved this by using the scrollbar1.valuechanged event.
vb Code:
scrollbar1.value = Int(scrollbar1.value * 2) / 2
this works but every time i move the mouse the valuechanged event is called twice firstly because of the drag secondly because i have changed the value. Although the performance decrease isn't small it would be good if i could do this using another event or another way...
p.s. the mouseleftbuttonup event isn't called when the thumb is dragged and released. can i for instance use the thumb class? i would imagine that thumb is a child of scrollbar somewhere along the line.
If debugging is the process of removing bugs, then programming must be the process of putting them in.
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
|