Jump to content

Redraw Inputbox


Recommended Posts

Hi everybody.

I have found Autoit recently, and i must admit i love it.

I've read alot in this forum till now, and I am very happy that you guys are here :P (Learnt alot)

So far...i have written a very long Proggram till now,....and everything is working properly.

But there is this little Problem i dont come around.

I have solved much bigger ones by myself,.....but this is giving me headache since 13hours!!!! ;)

I have spent alot time to limit it to the basics,...so that it is easier to read for you.

I dont get it how to redraw the Input-Box,...after a Function was called.

So that the number "5" reappers after a wrong input.

Probably its really easy to solve....but I dont get it.... :D

Would appreciate your help guys :D

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", 0)
Opt("GUIOnEventMode", 1)


global $input1



$LastSys = 5


main()

func main()
GUICreate("Form1", 328, 959, 933, 2)
GUICtrlSetState(-1, $GUI_SHOW)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "Minimize")
    GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Maximize")



    $input1 = GUICtrlCreateInput($LastSys, 108, 89, 40, 21, $ES_NUMBER)
    GUICtrlSetBkColor(-1, 0xC0C0C0)
    GUICtrlSetOnEvent(-1, "Change")

        GUICtrlCreateButton("START", 130, 370, 80, 45)
    GUICtrlSetCursor(-1, 0)
    GUICtrlSetOnEvent(-1, "START")

    GUICtrlCreateButton("Setze wieder zurück auf 5", 152, 87, 175, 25, $WS_GROUP)
    GUICtrlSetCursor(-1, 0)
    GUICtrlSetOnEvent(-1, "Restore")



    GUISetState()
    GUIGetMsg()
    GUISetState(@SW_SHOW)
    While 1
        sleep(1000)
    WEnd
EndFunc

;------------------------------------------------------------------------------------------



func change()
    $NewSys = GUICtrlRead($input1)
    Select
        Case $NewSys < 0 Or $NewSys > 9
            MsgBox("", "", "Ungültifer Wert(Inputfeld soll jetzt wieder auf 5 gesetzt werden)")
        Case $NewSys <> $LastSys
            MsgBox("", "", "Achtung es wird bei der Erkundung ein anderes System angeflogen als zuletzt damit aufgehört wurde")
    EndSelect
EndFunc


Func start()
    MsgBox(0, "", "START")
EndFunc   ;==>start


Func Restore()
$NewSys = GUICtrlRead($input1)
$NewSys = $LastSys

msgbox("","","$LastSys ist im Speicher 5 aber wird nicht geschrieben?")

    ;GUISetState()
    ;GUIGetMsg()
    ;Main()

EndFunc   ;==>restore


Func Close()
    Exit
EndFunc   ;==>Close
Func Maximize()
EndFunc   ;==>Maximize
Func Minimize()
EndFunc   ;==>Minimize
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...