Results 1 to 3 of 3

Thread: wpf scrollbar step property

  1. #1

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    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.

  2. #2

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    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.

  3. #3

    Thread Starter
    Fanatic Member Megalith's Avatar
    Join Date
    Oct 2006
    Location
    Secret location in the UK
    Posts
    879

    Re: wpf scrollbar step property

    ok kind of resolved this by using the scrollbar1.valuechanged event.

    vb Code:
    1. 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
  •  



Click Here to Expand Forum to Full Width