hier mal ein kleines Beispiel! hoffe das ist vollständig ![]()
AutoIt
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
$GUI_Bosys = GUICreate("test", 246, 120, 80, 220)
GUISetBkColor(0xC0C0B2)
;GUICtrlSetBkColor(-1,0x66CC00)
$Button2 = GUICtrlCreateButton("Support", 144, 16, 73, 25)
;GUICtrlSetBkColor(-1,0xff4D00)
$Checkbox1 = GUICtrlCreateCheckbox("1", 80, 60, 80, 25)
$Checkbox2 = GUICtrlCreateCheckbox("2", 80, 80, 150, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete($GUI_Bosys)
ExitLoop
Case $Button2
If _IsChecked($Checkbox1) Then
;MsgBox(0, "", "The checkbox is checked.", 0, $Form1)
Else
;MsgBox(0, "", "The checkbox is not checked.", 0, $Form1)
If _IsChecked($Checkbox2) Then
;MsgBox(0, "", "The checkbox is checked.", 0, $Form1)
EndIf
EndIf
Case $Checkbox1
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
;MsgBox(0,"", "häckchen drin")
GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
Else
;MsgBox(0,"", "häckchen draußen")
EndIf
;If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then MsgBox(0,"", $Checkbox2)
Case $Checkbox2
If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
;MsgBox(0,"", "häckchen drin")
Else
;MsgBox(0,"", "häckchen draußen")
EndIf
EndSwitch
WEnd
Func _CheckState($iState)
Switch $iState
Case $BST_CHECKED
Return 1;"Button is checked."
Case $BST_INDETERMINATE
Return "Button is grayed, indicating an indeterminate state (applies only if the button has the $BS_3STATE or $BS_AUTO3STATE style)."
Case $BST_UNCHECKED
Return 0;"Button is cleared"
EndSwitch
EndFunc ;==>_ExplainCheckState
Alles anzeigen