Wollte fragen wie man eine checkbox an + ausschalten kann mit if $checkbox = 1 Then ... /if $Checkbox1 = 0 Then .... funktionniert bei Soundplay irgendwie nicht ... wer weis wies das geht bitte mal posten :) .
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 136, 64, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox1
_Check()
EndSwitch
WEnd
Func _Check()
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
MsgBox(0 , "" , "Checkbox1 an!")
ElseIf GUICtrlRead($Checkbox1) = $GUI_UNCHECKED Then
MsgBox(0 , "" , "Checkbox1 aus!")
EndIf
EndFunc
Ja, die Checkbox...Quote:
$checkbox = 1 Then ... /if $Checkbox1 = 0 Then
Func _CheckboxSetState(ByRef $ControlID, $iState) Switch $iState Case 0 GUICtrlSetState($ControlID, 4) Case 1 GUICtrlSetState($ControlID, 1) EndSwitch EndFunc ;==>_CheckboxSetState Func _CheckboxGetState(ByRef $ControlID) Local $iState = GUICtrlRead($ControlID) Switch $iState Case 1 Return 1 Case 4 Return 0 EndSwitch EndFunc ;==>_CheckboxGetState
$state[2] = [4,1]
eigentlich nicht...Quote:
Dafür muss man doch dann eine globale Variable setzen?
MfG
Func _CheckboxSetState(ByRef $ControlID, $iState) Local $tmpState[2] = [4,1] GUICtrlSetState($ControlID, $tmpState[$iState]) EndFunc Func _CheckboxGetState(ByRef $ControlID) If GUICtrlRead($ControlID)=4 Then Return 0 Return 1 EndFunc