Jump to content

Need help on Window's slider control


nfaustin
 Share

Recommended Posts

Hi Guys,

I just want to ask how to change/update the value of Window's UI Slider control?

Here is the screenshot and Window info of it:

post-41730-1230006005_thumb.jpg

[font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]
Link to comment
Share on other sites

@nfaustin

Use a _GUICtrlSlider_SetPos function.

Example:

#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>

$hGUI = GUICreate("Test", 300, 200)

$cSlider = GUICtrlCreateSlider(50, 50, 200, 30)
GUICtrlSetLimit(-1, 100, 0)

$hSlider = GUICtrlGetHandle($cSlider)

$cButton_Set = GUICtrlCreateButton("Set", 11, 166, 75, 23)

$cButton_Close = GUICtrlCreateButton("Close", 211, 166, 75, 23)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE, $cButton_Close
            Exit
        Case $cButton_Set
            $iPos = _GUICtrlSlider_GetPos($hSlider)
            If $iPos < 50 Then
                _GUICtrlSlider_SetPos($hSlider, 75)
            Else
                _GUICtrlSlider_SetPos($hSlider, 25)
            EndIf
    EndSwitch
WEndoÝ÷ ØZ+ëmxrí®ajwez붢Z+¡Ö«¹nzÊZËr

Not tested!

Edited by rasim
Link to comment
Share on other sites

Hi Rasim,

Great... Its works... :)

Thanks a lot...

[font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...