Sign in to follow this  
Followers 0
Aceguy

IM A NOOB, SORRY..... (but we all gotta start somewhere)

3 posts in this topic

this is what i would like to.

imput a value in an inputbox,, like 10.

Then everytime i click the go button, it takes 1 off of ten, and displays it in the box till it reaches 0.

(so i will need to click go 10 times.)

Global $Qty_synth

#include <GUIConstants.au3>

$Form1 = GUICreate("AForm1", 150, 200, 900, 150)

$Go = GUICtrlCreateButton("Go!!!", 24, 64, 97, 33)

$Qty_synth = GUICtrlCreateInput(0, 10, 150, 175, 20)

GUISetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Go

$Qty_synth = GUICtrlRead($Qty_synth)

$Qty_synth = $Qty_synth - 1

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

EndSelect

WEnd

This is prolly a piece of cake for you guys

Thanks :D:D

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome to the forums :D

What you should do is whenever the Go button is pressed, store the number somewhere, take 1 from it, then put it back into the input box.

Global $Number

#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 150, 200, 900, 150)
$Go = GUICtrlCreateButton("Go!!!", 24, 64, 97, 33)
$Qty_synth = GUICtrlCreateInput(0, 10, 150, 175, 20)

GUISetState()

While 1
$msg = GUIGetMsg()
Select

Case $msg = $Go


$Number = GUICtrlRead($Qty_synth)
If $Number > 0 Then
    $Number = $Number - 1
    GUICtrlSetData($Qty_synth, $Number)
EndIf



Case $msg = $GUI_EVENT_CLOSE
ExitLoop

EndSelect
WEnd

Other than that good job, except it isnt a good idea to use the same variable that holds the handle to the input box to store your number.

Edited by Emperor

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