Jump to content

Recommended Posts

Posted (edited)

i want this: 01 + 1 = 02 NOT 2

#include <GUIConstantsEx.au3>
Global $GUI[4]

$GUI[0]= GUICreate("test", 300, 70)
$GUI[1] = GuiCtrlCreateInput("01", 75, 22, 150, 20)
$GUI[2] = GUICtrlCreateButton("+ 1", 230, 21, 50, 22)
GUICtrlCreateLabel("Index 1:", 20, 25)
GUISetState()
While 1
    $GUI[3] = GUIGetMsg($GUI[0])
    Select
        Case $GUI[3] = $GUI_EVENT_CLOSE
            Exit
        Case $GUI[3] = $GUI[2]
            GUICtrlSetData($GUI[1], GUICtrlRead($GUI[1]) + 1)
    EndSelect
WEnd
Edited by Merchants
Posted (edited)

Hi,

if you want the leading 0 only for numbers < 10:

@edit:

Delete nasty code, use Malkeys....

;-))

Stefan

Edited by 99ojo
Posted (edited)

Here is a StringFormat example for you to ponder.

I did now. :)

There was a paste and copy typo error trying your 1st code example, which is absolutly correct.

:(

Stefan

Edited by 99ojo

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
  • Recently Browsing   0 members

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