Click here to Skip to main content
15,890,947 members
Articles / Programming Languages / C#
Article

C# RangeBar control

Rate me:
Please Sign up or sign in to vote.
4.81/5 (21 votes)
8 Jul 2003 157.7K   3.6K   67   30
A control that combines two scrollbars for choosing two related values

Image 1

Introduction

If you want to give the user the possibility to define a number interval to set a two side threshold in an image processing program, then you can use two scrollbars, first for lower and second for upper limit. Further you have to catch changing events to prevent that lower limit is higher than the upper.

Wouldn't it be easier to have a control that combines two scrollbars?

The ZzzzRangeBar is a two button slide control for setting an integer number interval. If you push with a left click on a slide button it will marked and while mouse button is pressed you can move the slider left and right. Otherwise you can use the keys + and - to manipulate the slider position.

The control will throw two events. While left mouse button is pressed and the position of one slider has changed the event OnRangeChanging will generate and if you release mouse button, the event OnRangeChanged signals program that a new range was selected.

History

16 May 2002 first version of rangebar control

7 June 2003  enhancing control with vertical orientation and different scaling ticks options

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralVS 2002 Pin
MtnBiknGuy23-Oct-03 9:18
MtnBiknGuy23-Oct-03 9:18 
GeneralVery good, but Pin
Gary Sui28-Jun-03 12:59
Gary Sui28-Jun-03 12:59 
GeneralRe: Very good, but Pin
Anonymous3-Jul-03 0:49
Anonymous3-Jul-03 0:49 
GeneralMinor improvments Pin
20-May-02 0:14
suss20-May-02 0:14 
GeneralThank you...!!! Pin
17-May-02 14:23
suss17-May-02 14:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.