-
Reverse Scrollbar
Is it possible to have an horizontal scrollbar act as a vertical scrollbar.
I have a panel with a HScrollbar at the bottom of it.
I would like to slide the scrollbar from left to right and have the content of the panel move up or down.
Thank you,
Pierre
-
Re: Reverse Scrollbar
You can do this easily with a composite control, but it would be difficult to "re-wire" the existing functionallity.
-
Re: Reverse Scrollbar
Hi pierrewhy,
it can be easily achieved with layout transform in WPF.
I wanted to create a NumericUpDown control that would increase the number in a textbox when scroll up is pressed and decrease when scroll down is pressed. To achieve that I used:
<ScrollBar Name="scrollBar" Grid.Column="1"
Value="{Binding Path=Text, ElementName=textBox}"
Maximum="{Binding MaxValue}"
Minimum="{Binding MinValue}"
LargeChange="{Binding Change}"
SmallChange="{Binding Change}">
<ScrollBar.LayoutTransform>
<RotateTransform Angle="180" />
</ScrollBar.LayoutTransform>
</ScrollBar>
The most important for you is the LayoutTransform part.
I know you probably do not need it, but there are others who might.
Cheers,
Michal.
-
Re: Reverse Scrollbar
Michal,
For WPF that is indeed a good solution. When the question was posted about 3 years ago, the presumption was that it was WinForms....
-
Re: Reverse Scrollbar
That is correct. I just wanted to update the topic for people like me who look for such information now ;).
-
Re: Reverse Scrollbar
Just remember there is a DIFFERENT forum here for WPF....
http://www.codeguru.com/forum/forumdisplay.php?f=99
-
Re: Reverse Scrollbar