CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2008
    Posts
    7

    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

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,117

    Re: Reverse Scrollbar

    You can do this easily with a composite control, but it would be difficult to "re-wire" the existing functionallity.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Jun 2011
    Posts
    3

    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.

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,117

    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....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  5. #5
    Join Date
    Jun 2011
    Posts
    3

    Re: Reverse Scrollbar

    That is correct. I just wanted to update the topic for people like me who look for such information now .

  6. #6
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,117

    Re: Reverse Scrollbar

    Just remember there is a DIFFERENT forum here for WPF....

    http://www.codeguru.com/forum/forumdisplay.php?f=99
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  7. #7
    Join Date
    Jun 2011
    Posts
    3

    Re: Reverse Scrollbar

    Thank you MVP!

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

Featured