Sign in to follow this  
Followers 0
kcd-clan

can i get a sample

2 posts in this topic




#2 ·  Posted (edited)

$neufenster = GuiCreate("Neue Arbeit einspeichern", 285, 378,(@DesktopWidth-285)/2, (@DesktopHeight-378)/2)

$Label_1 = GuiCtrlCreateLabel("Fach:", 30, 20, 30, 20)
$fach = GuiCtrlCreateInput("Fach", 90, 20, 190, 20)
$Label_3 = GuiCtrlCreateLabel("Datum", 30, 60, 40, 20)
$Datum = GuiCtrlCreateDate("Date4", 90, 60, 190, 20, $DTS_SHORTDATEFORMAT)
$Label_5 = GuiCtrlCreateLabel("Kommentar", 20, 100, 60, 20)
$kommentar = GuiCtrlCreateEdit("Ein Kommentar" & @crlf & "(z.B.: was gelernt werden muss)", 100, 100, 180, 230)
$save = GuiCtrlCreateButton("Speichern", 10, 340, 90, 30)
$abort = GuiCtrlCreateButton("Abbrechen", 190, 340, 90, 30)

GUISetState( @sw_hide , $Hauptfenster)
GuiSetState( @sw_show, $neufenster)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $abort
        exit
    Case $msg = $save
        IniWrite($inifile, guictrlread($fach) & ", " & Guictrlread($datum) , "Datum", Guictrlread($datum))
        DirGetSize( @programfilesdir & "\Arbeiten\" )
        if @error = 1 Then
            msgbox(0, "", @programfilesdir & "\Arbeiten\" & @crlf &"wird erstellt")
            DirCreate(@programfilesdir & "\Arbeiten\")
        EndIf
        $fileread = neufile( @programfilesdir & "\Arbeiten\" & Guictrlread($fach) & " " &guictrlread($datum) & ".kom" )
        $file_read = GUICtrlRead($kommentar)
        FileWrite ( @programfilesdir & "\Arbeiten\" & Guictrlread($fach) & " " &guictrlread($datum) & ".kom", "" & $File_Read )
        msgbox(0, "Gespeichert!", "Die " & guictrlread($fach) & "arbeit wurde erfolgreich für den " & Guictrlread($datum) & " eingetragen!")
        ExitLoop
    EndSelect
WEnd
exit
    
EndFunc

Edited by Analritter

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

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