Jump to content

Set a input box back to default??

Recommended Posts

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

While 1
    $GUI[4] = GUIGetMsg($GUI[0])
    Case $GUI[4] = $GUI_EVENT_CLOSE
        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
                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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...