comme le bouton back :
merci.
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 202, 191, 192, 114)
$Button1 = GUICtrlCreateButton("sortir", 56, 120, 75, 25, $WS_GROUP)
GUICtrlSetState($Button1, $GUI_DISABLE)
$Checkbox1 = GUICtrlCreateCheckbox("activer le bouton", 48, 56, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button1
Exit
case Else
if GUICtrlRead($Checkbox1) = 1 Then
GUICtrlSetState($Button1, $GUI_ENABLE)
Else
GUICtrlSetState($Button1, $GUI_DISABLE)
EndIf
EndSwitch
WEnd
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 202, 191, 192, 114)
$Button1 = GUICtrlCreateButton("sortir", 56, 120, 75, 25, $WS_GROUP)
GUICtrlSetState($Button1, $GUI_DISABLE)
$Checkbox1 = GUICtrlCreateCheckbox("activer le bouton", 48, 56, 97, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button1
Exit
case Else
if GUICtrlRead($Checkbox1) = 1 and GUICtrlGetState($Button1) <> $GUI_ENABLE Then
GUICtrlSetState($Button1, $GUI_ENABLE)
Elseif GUICtrlRead($Checkbox1) = 0 and GUICtrlGetState($Button1) <> $GUI_DISABLE Then
GUICtrlSetState($Button1, $GUI_DISABLE)
EndIf
EndSwitch
WEnd