Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Slider Control Values

Status
Not open for further replies.

jacobpressures

Technical User
Jun 17, 2004
71
US
The values on the slider control start with 0 at the top and 100 at the bottom. I'm using vertical orientation.

Is is possible to reverse the numbers so that they are 100 at the top and 0 at the bottom?

I've tried the code

slider1.ToolTipText = 100 - slider1.value & "%"

But ToolTipText is different from the values that appear.

When i tried
slider1.value = 100 - slider1.value

It does wierd things.

If i can't change the values, i would like to prevent the values from appearing.


Thanks!
 
I did a little fooling around, and a few things became clear:
1. ToolTipText is not the same as the numbers that appear when you drag the slider. If you let go the mouse button and just hold the mouse over the slider, the tooltip text appears and shows the correct value.

2. You can't suppress the numbers.

3. You can't make the value property run in descending order.

Other than those things, you have all sorts of stuff you can do. :(

Maybe you can work with the API to accomplish what you're looking for, although I don't know how. SendMessage, for example. Maybe one of the API gurus here can suggest something.

HTH

Bob
 
I recently created a simple custom slider control using the Line control and a Command button.

For my purposes I used a horizontal line and in the Mouse Down - Mouse Move events of the Command button ensured that the button never moved beyond the x1, x2 and y1 y2 co-ordinates of the Line control.

Alan

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Try this mini program

SLIDERBACK.ZIP

It basically uses a second variable to calculate the value of 100 - the SliderValue and uses an imagebox around the slider to calculate mouse movements and create a ToolTip of its own using a label that moves with mouse and disappears after four seconds of Slider Inactivity.

Could probably use a bit of tweaking but its a start.


yosherrs.gif

[tt]'Very funny, Scotty... Now Beam down my clothes.'[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top