Sign in to follow this  
Followers 0
cyanidemonkey

Vertical slider question

4 posts in this topic

I have a slider for a volume level, I thought I'd have it vertical instead of horizontal.

$volume = GUICtrlCreateSlider(300, 304, 18, 89, $TBS_VERT)

Problem is when the slider is set to VERT, it seems to be upside down, ie, scroll up to 0, down to 100 :whistle: I've tried BitOr $TBS_RIGHT and BitOr $TBS_LEFT which changes the side the slider arrow points, but the 0 level remains at the top, 100 at the bottom and I can't find anything in the styles that looks like it might do it the other way round.

Is there a work around for this?


My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Or you can just simply formulate a reverse count translation...

#include <GuiConstants.au3>

$Gui = GuiCreate("Slider Vert Reverse", 250, 160)
$Slider = GUICtrlCreateSlider(20, 20, 18, 89, $TBS_VERT)
$Label = GUICtrlCreateLabel(100 - GUICtrlRead($Slider), 19, 110, 30, 15)
GUISetState(@SW_SHOW, $Gui)

$SliderOld = (100 - GUICtrlRead($Slider))

While 1
    If $SliderOld <> (100 - GUICtrlRead($Slider)) Then 
        GUICtrlSetData($Label, 100 - GUICtrlRead($Slider))
        $SliderOld = (100 - GUICtrlRead($Slider))
    EndIf   
    $Msg = GUIGetMsg()
    Select
        Case $Msg = -3
            Exit
    EndSelect
WEnd

You did ask for a work around , just keeping your options open :whistle:

Cheers

Edit: If your setting the limit of the slider to something other then the default 100 eg: 1000

Then use 1000 - GuiCtrlRead($slider).

Edited by smashly

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0