Jump to content
Sign in to follow this  
Merchants

Set a input box back to default??

Recommended Posts

Merchants

I wana set the input box to numbers wel that works

but then i wana set it back to default and that does not work got a idea to fix?

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>

Global $GUI[5]

$GUI[0] = GUICreate("test1", 250, 30)
$GUI[1] = GuiCtrlCreateInput("", 5, 5, 100, 20)
$GUI[2] = GUICtrlCreateButton("Change Style", 110, 4, 135, 22)
$GUI[3] = True
GUISetState()

While 1
    $GUI[4] = GUIGetMsg($GUI[0])
    Select
    Case $GUI[4] = $GUI_EVENT_CLOSE
            Exit
        Case $GUI[4] = $GUI[2]
            If $GUI[3] Then
                GUICtrlSetStyle($GUI[1], $ES_NUMBER)
                GUICtrlSetData($GUI[1], "")
                GUICtrlSetData($GUI[2], "Change Style to normal")
                MsgBox(64,"Change Style", "Input change to numbers only")
                $GUI[3] = False
            Else
                GUICtrlSetStyle($GUI[1], Default) ;Some how this does not work...
                GUICtrlSetData($GUI[1], "")
                GUICtrlSetData($GUI[2], "Change Style")
                MsgBox(64,"Change Style", "Input change to Default")
                $GUI[3] = True
            EndIf
    EndSelect
WEnd

Share this post


Link to post
Share on other sites
Merchants

works ty

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  

×