Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How to call function of checkbox of array ?

$
0
0
Hi,

I have a problem to call the function with it's name.

I created multiple checkbox with the array, then when I want to read the state of checkboxes, I can't recover it.

In this program, I want to call function with it's name. Before I must check the state of the checkbox, and I don't know how to do. :(


[ autoit ]         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <ProgressConstants.au3> #include <Array.au3> $Fenetre_principale = GUICreate("Outils de sécurité", 300, 280) $Tailles_fenetre = WinGetPos("Outils de sécurité") $Label_enregistrement = GUICtrlCreateLabel("Dossier d'enregistrement : ", 10, 12, 150) GUICtrlSetFont($Label_enregistrement, 8.5, 600, 4) GUICtrlSetColor($Label_enregistrement, 0x007399) $Boutton_selection_dossier = GUICtrlCreateButton("Sélectionner", 165, 8, 87, 25) $Label_selection_dossier = GUICtrlCreateInput("", 10, 40, 280, 21) $Executer = GUICtrlCreateButton("Executer", $Tailles_fenetre[2]/3 - 75, $Tailles_fenetre[3] - 69, 100) $Ouvrir_dossier = GUICtrlCreateButton("Ouvrir le dossier", $Tailles_fenetre[2] - $Tailles_fenetre[2]/3 - 35, $Tailles_fenetre[3] - 69, 100) GUICtrlSetState($Executer, $GUI_DISABLE) GUICtrlSetState($Ouvrir_dossier, $GUI_DISABLE) Global $Array[6] $Array[0] = "Stinger" $Array[1] = "Spybot" $Array[2] = "Dr.Web CureIt!" $Array[3] = "Malwarebytes" $Array[4] = "AdwCleaner" $Array[5] = "Gmer" $Top = 70 ; 1st) ------------ For $i = 0 To UBound($Array, 1) - 1 $Array[$i] = GUICtrlCreateCheckbox($Array[$i], 10, $Top, 120) GUICtrlSetFont($Array, 8.5, 400, 4) GUICtrlCreateProgress(130, $Top, 128) GUICtrlCreateLabel("", 263, $Top, 37, 21, $SS_CENTERIMAGE) $Top += 25 Next ; 2nd) ------------ For $Programmes In $Array ConsoleWrite("AB : " & $Programmes & @CRLF) $Checkbox = GUICtrlCreateCheckbox($Programmes, 10, $Top, 120) GUICtrlSetFont($Checkbox, 8.5, 400, 4) GUICtrlCreateProgress(130, $Top, 128) GUICtrlCreateLabel("", 263, $Top, 37, 21, $SS_CENTERIMAGE) $Top += 25 ConsoleWrite($Checkbox & @CRLF) Next ; ------------ GUISetState() Do $Action = GUIGetMsg() Select   Case $Action = $Boutton_selection_dossier    $Selection_dossier = FileSelectFolder("Veuillez sélectionner l'emplacement des téléchargements :", @HomeDrive & "\")    If @error <> 1 Then     If StringRight($Selection_dossier, 1) <> "\" Then      $Emplacement_des_telechargements = $Selection_dossier & "\__Programmes de sécurité__"     Else      $Emplacement_des_telechargements = $Selection_dossier & "__Programmes de sécurité__"     EndIf     GUICtrlSetData($Label_selection_dossier, $Emplacement_des_telechargements)     GUICtrlSetState($Executer, $GUI_ENABLE)    EndIf   Case $Action = $Executer ;~    DirCreate($Emplacement_des_telechargements) ;~    GUICtrlSetState($Ouvrir_dossier, $GUI_ENABLE)   Case $Action = $Ouvrir_dossier    ShellExecute($Emplacement_des_telechargements) EndSelect Until $Action = $GUI_EVENT_CLOSE Func Stinger() EndFunc


Thanks in advance

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>