erstmals kurz zu meiner Person. Ich bin 34 Jahre alt und beschäftige mich nebenbei mit AHK, um mir meine tägliche Arbeit etwas zu erleichtern.
Ich lese schon einige Zeit im Forum mit und habe schon viel nützliches dabei mitgenommen.
Im Moment, stehe ich aber etwas an.
Ich habe ein kleines GUI gebastelt, welches die eingetragenen Werte in ein TXT File schreibt.
Beim Klick auf den Weiter-Button, wird geprüft ob alle Felder befüllt sind. Falls ja, werden die Daten geschrieben und alles funktioniert wie gewollt.
Mein Problem besteht dann, wenn ein Feld nicht befüllt wird. Habe das zur Zeit so gelöst, dass die ganze GUI neu geladen wird. Somit sind aber auch wieder alle Edit's leer.
Kann man das so realisieren, dass die bereits befüllten Edit's auch befüllt bleiben?
Anbei der Code:
Code: Select all
CV_GUI:
Gui CV:New, +Border -MinimizeBox -MaximizeBox -SysMenu, Commvault Backup
Gui CV:Show, w540 h260
Gui CV:Color, White
Gui CV:Font, s10 Bold c0x006DC3, Meiryo
Gui CV:Add, Text, x15 y10 w170 h20 +0x200, 5. Commvault Backup
Gui CV:Font
Gui CV:Font, s9, Meiryo
Gui CV:Add, Link, x290 y13 w160 h20, <a href="http://commserve.austria.local:81/console">Link zur Commvault Console</a>
Gui CV:Add, Text, x10 y35 w520 h2 0x10
Gui CV:Add, Text, x15 y50 w70 h20 +0x2 +0x200, Protected Obj.:
Gui CV:Add, Text, x90 y50 w120 h20 +0x2 +0x200, Failed Obj.:
Gui CV:Add, Text, x295 y50 w70 h20 +0x2 +0x200, Failed Folders:
Gui CV:Add, Edit, x90 y50 w30 h20 vCVPO
Gui CV:Add, Edit, x220 y50 w30 h20 vCVFO
Gui CV:Add, Edit, x370 y50 w30 h20 vCVFF
Gui CV:Add, Edit, x20 y90 w500 h80 vCVEdit
Gui CV:Add, Text, x10 y175 w520 h2 0x10
Gui CV:Add, Text, x15 y180 w115 h20 +0x200, Vordefinierte Einträge...
Gui CV:Add, Link, gCVtxt x40 y200 w120 h20, <a id="CVTxt">keine Auffälligkeiten</a>
Gui CV:Font
Gui CV:Add, Text, x10 y220 w520 h2 0x10
Gui CV:Add, Button, gSave_CV x440 y230 w80 h20, Weiter >
ControlFocus, Edit1, Commvault Backup
return
Save_CV:
GuiControlGet CVEdit
GuiControlGet CVPO
GuiControlGet CVFO
GuiControlGet CVFF
if CVEdit =
{
MsgBox Kein Eintrag vorhanden
Goto CV_GUI
}
if CVPO =
{
MsgBox Bitte Protected Objects eintragen
Goto CV_GUI
}
if CVFO =
{
MsgBox Bitte Failed Objects eintragen
Goto CV_GUI
}
if CVFF =
{
MsgBox Bitte Failed Folders eintragen
Goto CV_GUI
}
Else
FileAppend,
(
5. Commvault Backup
-----------------------------------------------------
Protected Objects: %CVPO%
Failed Objects: %CVFO%
Failed Folders: %CVFF%
Sonstiges:
%CVEdit%
-----------------------------------------------------
), %Filename%
GuiControl, Main:, CVChk, 1
GuiControl, Main:Hide, ME_CVB
GuiControl, Main:Show, ME_CVB_Green
WinClose, Commvault Backup
Goto CapMB_GUI
return
Danke
LG
con