Results 1 to 4 of 4

Thread: [RESOLVED] vertical trackbar (min value on top)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2010
    Location
    Glogow, Poland
    Posts
    104

    Resolved [RESOLVED] vertical trackbar (min value on top)

    Hi there all good people,

    Please help me with this one as it drives me crazy.

    I'm using a vertical trackbar. I got it all set: minimum and maximum values, tickfrequency etc... and so on... everything works great.

    The only problem is that I would like to have the minimum value of the trackbar on the top.

    In horizontal trackabar you can choose the RightToLeft property to put the minimum value to the left or to the right, but how do I make it to put the minimum value on the top if I have it in vertical orientation?

    There has to be a way to somehow "flip" it... but how?

    Please help


    EDIT:
    here is a link to video on youtube, which show my problem.
    I want it to be the other way round - from top to bottom:
    http://www.youtube.com/watch?v=cnQTRbF2kWk
    Last edited by marl; Aug 29th, 2011 at 03:40 PM. Reason: added a youtube link

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: vertical trackbar (min value on top)

    You might be able to use a WPF slider control, and integrate it into your winforms application.
    http://www.switchonthecode.com/tutor...pf-in-winforms
    That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma

    Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: vertical trackbar (min value on top)

    What does it really matter? The TrackBar doesn't actually display numbers anyway so just get and set the Value through a property that performs the appropriate transformation:
    vb.net Code:
    1. Public Property ActualValue() As Integer
    2.     Get
    3.         Return TrackBar1.Maximum - TrackBar1.Value + TrackBar1.Minimum
    4.     End Get
    5.     Set(ByVal value As Integer)
    6.         TrackBar1.Value = TrackBar1.Maximum - value + TrackBar1.Minimum
    7.     End Set
    8. End Property
    Last edited by jmcilhinney; Aug 30th, 2011 at 12:14 AM. Reason: Included Minimum to allow for non-zero Minimum value
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2010
    Location
    Glogow, Poland
    Posts
    104

    Re: vertical trackbar (min value on top)

    Thanks a lot jmcilhinney.

    It works as I wanted it to work.

Tags for this Thread

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