allez, entrons dans le vif du sujet. je crée un certains nombre de checkbox de la manière suivante
j'ai tenté un truc dans le genre :
Merci à tous, bonne soirée
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
Local $text = ""
Global $Form1 = GUICreate("Form1", 243, 600, 192, 90)
$top = 1
Local $array[21]
Local $arrayL[21] =["coucou1","coucou2","coucou3","coucou4","coucou5","coucou6","coucou7","coucou8","coucou9" _
,"coucou10","coucou11","coucou12","coucou13","coucou14","coucou15","coucou16","coucou17","coucou18","coucou19","coucou20","coucou21"]
For $i = 0 To 20
$array[$i] = GUICtrlCreateCheckbox("", 25, $top, 185, 25)
GUICtrlSetData(-1, $arrayL[$i])
$top += 26
Next
$button = GUICtrlCreateButton("OK",25, 550, 50,50)
$button1 = GUICtrlCreateButton("check",85, 550, 50,50)
GUISetState(@SW_SHOW)
_ArrayDisplay($array,"ID enregistrés")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button
For $y = 0 To UBound($array) - 1
If _IsChecked($array[$y]) Then
$text = ControlGetText($Form1,"",$array[$y])
Switch $text
Case "coucou1"
ShellExecute("http://autoitscript.fr/forum/viewtopic.php?f=3&t=13857")
Case "coucou2"
ShellExecute("https://google.fr/")
Case Else
MsgBox(0,$text,$array[$y],1)
EndSwitch
Else
ConsoleWrite($array[$y] & " is not checked." & @CR)
EndIf
Next
Case $button1
For $y = 0 To UBound($array) - 1
If _IsChecked($array[$y]) <> $GUI_CHECKED Then
GUICtrlSetState($array[$y],$GUI_CHECKED)
Else
GUICtrlSetState($array[$y],$GUI_UNCHECKED)
EndIf
Next
Case $array[0] To $array[20]
$text = ControlGetText($Form1,"",$nMsg)
If _IsChecked($nMsg) Then
Switch $text
Case "coucou1"
ShellExecute("http://autoitscript.fr/forum/viewtopic.php?f=3&t=13857")
Case "coucou2"
ShellExecute("https://google.fr/")
Case Else
MsgBox(0, "", $text & " is checked.",1)
EndSwitch
Else
MsgBox(0, "", $text & " is not checked.",1)
EndIf
EndSwitch
WEnd
Func _IsChecked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc ;==>_IsChecked
Code : Tout sélectionner
Local $a = "aaa", $b = Binary(0x43), $c = 567
AdlibRegister(Show, 941)
For $i = 0 To 99
$a &= 1
$b += 1
$c += 3
Sleep(30000)
Next
Func Show()
Static $OQP = 0
If Not $OQP Then
$OQP = 1
Local $vars = [$a, $b, $c]
; faire une combobx pour le choix de la variable à afficher
; on récupère l'index de la variable choisie
MsgBox(0, "", _VarDump($var[$k]))
$OQP = 0
EndIf
EndFunc