views:

21

answers:

1

I have an slider control in my application and an image control. When the slider value is going up, the image is zoomed in and vice versa.

In addtion i have a zoom-in and a zoom-out button. the zoom-in button will increase the slider value by one smallchange and the zoom-out will decrease it.

What i want: while the zoom-in (and out) button is pressed i want to slider to keep increasing(performin a zoom in) and not just one time.

In other words, as long as the left button is pressed, i want to keep performing the mousebuttonpressed on the button until the mousebutton is released.

Oh, by the way, im using Silverlight 3.

Thanks.

+1  A: 

You can use the RepeatButton class to do this. It raises it's click event repeatedly while held down, much like the thumb of a scrollbar or an up/down spinner.

http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.repeatbutton(VS.95).aspx

Josh Einstein