Bitte wie stelle ich dies an, damit die "Feldauswahl" geprüft wird, bevor ein leeres MsgBox Fentser aufklappt.
Danke
MC
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Example1()
Func Example1()
Local $hname, $section, $msg, $ButtonMsg, $ButtonEnd
GUICreate(" GUI ", 200, 250) ; will create a dialog box that when displayed is centered
GUICtrlCreateLabel("HostName ", 11, 80)
$hname = GUICtrlCreateCombo("", 10, 103)
$section = IniReadSection("muster.ini", "HostName")
For $i = 1 To UBound($section) - 1
GUICtrlSetData($hname, $section[$i][1])
Next
$ButtonMsg = GUICtrlCreateButton("Button Msg", 20, 150)
$ButtonEnd = GUICtrlCreateButton("Button End", 90, 150)
GUISetState(@SW_SHOW) ; will display an empty dialog box
While 1
$msg = GUIGetMsg()
Select
;Case $GUI_EVENT_CLOSE
; ExitLoop
Case $msg = $ButtonMsg
[/autoit] [autoit][/autoit] [autoit];GUICtrlSetState($ButtonMsg, $GUI_ENABLE)
If GUICtrlRead($msg = $ButtonMsg) then
MsgBox(1, "", "Feld zuerst ausfüllen")
EndIf
MsgBox(1, "", GUICtrlRead($hname))
[/autoit] [autoit][/autoit] [autoit]Case $msg = $ButtonEnd
ExitLoop ;MsgBox(0, 'Testing', 'Button 2 was pressed')
EndSelect
WEnd
EndFunc
If $msg = $GUI_EVENT_CLOSE Then ExitLoop