Edit Feld mit Checkbox ein und ausblenden

  • Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Res_Description=Uinstall Parameter
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.1
    #AutoIt3Wrapper_Res_LegalCopyright=Klaus Schulz
    #AutoIt3Wrapper_Res_Language=1031
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt('MustDeclareVars', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Example()

    [/autoit] [autoit][/autoit] [autoit]

    Func Example()
    Global $gui, $Start_Installation, $Abbrechen, $ProductKey, $Name, $Organisation, $AnF = '"'
    Global $Aufloesung, $Insttyp, $Insttyp_Fag, $check_iView_X, $check_iTools, $check_Experiment_Center
    Global $check_Begaze, $check_Logitech, $check_Scandisk, $check_WinClam, $check_Sysprep, $msg, $Sysprep = ".\sysprep.inf"
    Global $Install_log = "D:\Recorded Data\Install_LOG\Install_Log.txt"
    Global $Konfig_Bat = "C:\Flag_Konfig.bat"

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUICoordMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    $gui = GUICreate("Windows XP iView X UNENTENDET Parameter", 820, 400, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateLabel("Produkt Key? z.B.: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx", 20, 10)
    $check_Sysprep = GUICtrlCreateCheckbox("Sysprep Starten", 20, 370, 130, 20) ;erstellen einer checkbox

    [/autoit] [autoit][/autoit] [autoit]

    $Start_Installation = GUICtrlCreateButton("Start Installation", 440, 175, 120, 20)
    $Abbrechen = GUICtrlCreateButton("Abbrechen", 440, 210, 120, 20)
    $ProductKey = GUICtrlCreateInput("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", 400, 10, 199, 20)
    GUICtrlSetState(-1, $GUI_HIDE)
    GUISetState() ; will display an dialog box with 2 button

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $Start_Installation
    FileDelete($Konfig_Bat)
    Sleep(1000)
    ;$check_Sysprep = GUICtrlCreateCheckbox ("Sysprep Starten", 20, 370, 130, 20) ;erstellen einer checkbox
    IniWrite(@ScriptDir & $Sysprep, "UserData", "ProductKey", GUICtrlRead($ProductKey)) ; ProductKey wird in die Ini Datei geschrieben
    FileWriteLine($Install_log, "INSTALLATIONS PROTOKOLL") ;INSTALLATIONS PROTOKOLL wir in Install_log geschrieben
    FileWriteLine($Install_log, "ProductKey=" & GUICtrlRead($ProductKey)) ;ProductKey wir in Install_log geschrieben
    Sleep(1000)
    ExitLoop
    Case $msg = $check_Sysprep
    If BitAND(GUICtrlRead($check_Sysprep), $GUI_CHECKED) = $GUI_CHECKED Then
    GUICtrlSetState($ProductKey, $GUI_SHOW)
    ElseIf BitAND(GUICtrlRead($check_Sysprep), $GUI_UNCHECKED) = $GUI_UNCHECKED Then
    GUICtrlSetState($ProductKey, $GUI_HIDE)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Case $msg = $Abbrechen
    Sleep(1000)
    FileWriteLine($Konfig_Bat, "Set INSTABBRESCHEN=JA")
    Sleep(1000)
    ExitLoop

    [/autoit] [autoit][/autoit] [autoit]

    EndSelect
    WEnd
    EndFunc ;==>Example

    [/autoit]