Jump to content

Slider and Set data for Label


Recommended Posts

Im having trouble getting this to work, when i move the slider, it should set the % for the label,

$s = GuiCtrlCreateSlider (0,0,200,20)
$label = GUIctrlcreatelabel("",30,100,70,20)

$p = 100
$last = 100

While 1
    Sleep(10)
    $p = GuictrlRead($s)
    If $last = $p Then
    Else
    GUICtrlsetdata("handle=" & $label, $p & "%" )
                  
    $last = $p
    EndIf
wend
Link to comment
Share on other sites

you got to do the setlimit command also, i'll edit ur script, it'll take a sec.

Edit: here ya go, there is no exit thing, just what you asked for(i hope)

$GUI = GUICreate("Slider test")
$slider = GuiCtrlCreateSlider (0,0,200,20)
GUICtrlSetLimit ($slider,100,0)
$label = GUIctrlcreatelabel("",30,100,70,20)
GUISetState()
$procent = 100
While 1
    Sleep(10)
    $procent = GuictrlRead($slider)
    GUICtrlsetdata($label,"Slider= "&$procent&"%" )
wend
Edited by zeroZshadow
*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
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...