Enhanced Multislider Control

Sample Image

Environment: Developed with VC++6 SP3, tested on NT4 SP3, Win9x and Win2K (see below)

The slider control described in this article is an extension of the cute CMultislider control by Terry Braxton. Here is a list of the enhancements I introduced:
  1. Full support to multiple layout:
    • Horizontal and vertical orientation
    • Markers' arrows may point both top/left and bottom/right (this works fine, only some tiny graphical flaws were noticed occasionally on some platforms - especially Win2K. Any fix is welcome!).
    • Possibility of inverting ranges (from left to right and viceversa and top-down or viceversa). I introduced this because I needed a vertical Slider, and it looked better going upwards, while the default was the opposite.
    • The control works fine (graphic is OK) for any reasonable size.
  2. Markers that are dragged outside the control may disappear (behaviour on original control) or simply stop at the end of the sliding channel.

  3. Markers in original control may overcross (?) so that you could drag the leftmost to become the rightmost and viceversa. I found little use of this for my purpouses - to say it all, I wanted to avoid it! Now such a behaviour is configurable.

  4. Original control had two cool right-click effects: change of intervals colors (cliccking on intervals) and setting of exact position of a marker (cliccking on the marker itself). Now you can decide what the user can or can't do.

  5. I found the focus rect disturbing in my application. You can remove it setting an apposite flag.

  6. A notification mechanism
  7. is set, so that parent window knows when the user modifies position of a marker in the control.

To set all of these features (excluded orientation, which must be decided in the usual way), all you need is to pass a suitable mask to Init function, together with usual parameters (Min and Max ranges, number of ticks, number of markers, list of colors...)

      for (int j=0; j<SLIDERS_NUM; j++)
	      m_Slider[j].Init(min, max, 10, m_NumMarkers, NULL, colors, LayOut);  

All that you need is to include few files in your project. See comment in the zip of Demo project for more info.


Download demo project - 51 Kb
Download executable - 511 Kb


  • Good Control but require some enhancement

    Posted by Legacy on 07/29/2002 12:00am

    Originally posted by: Amit

    I think contol is good but if any one can suggest how to change the markers/sliders color then it is very useful to me.

  • CMultiSlider Control by Terry Braxton?

    Posted by Legacy on 07/03/2002 12:00am

    Originally posted by: Proferit

    Where can I find this?

  • Good Idea, Poorly Written

    Posted by Legacy on 06/08/2001 12:00am

    Originally posted by: Bill

    This version of the Slider Control is a good idea but only from the standpoint of multiple markers and colors.

    The implementation is extremely poor and the tooltip implementation from the days of DOS. The Windows version of the Slider Control already supports tooltips and it should be used.

    This control must also support user click in the slider rect to move the marker or it is next to useless (a user would first attempt to quickly move the marker by clicking in a relative position and expect the marker to move to it like the normal Windows Slider Control.) But this is not implemented.

    I must thank the author for a very good start. Somebody else should be able to take this and run with it, to bring it to a quality implementation.

    If I have time, I may do this myself.

    Best Regards,


Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Enterprises are increasingly looking to platform as a service (PaaS) to lower their costs and speed their time to market for new applications. Developing, deploying, and managing applications in the cloud eliminates the time and expense of managing a physical infrastructure to support them. PaaS offerings must deliver additional long-term benefits, such as a lower total cost of ownership (TCO), rapid scalability, and ease of integration, all while providing robust security and availability. This report …

  • Anthony Christie, the Chief Marketing Officer for Level Communications, is responsible for customer experience, worldwide marketing and product management. In this informative asset, he shares his insights into why a private network connection to cloud-bases applications is the right decision for your enterprise. Download now to find out more.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date