Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/06/2022 in all areas

  1. The problem you are encountering is that you are not assigning the radio buttons to a variable. The easiest way to do this is with Assign and Eval (listed in the help file). Another way is to add a column to your $aArray and assign the radio button to the 2nd column of the array when the radio is created. This method is just as good, but will make you re-work all your $aArray reads. Anyways, I guess you will choose Assign/Eval, so this will be a good learning experience for you. Assign/Eval are great tools when you are automatically generating lots of buttons, radios, combo boxes, etc. Basically, when you are creating the radios, it will assign them $Radio1, $Radio2, $Radio3 and you can read them exactly with those variables or you can read them in loops with Eval("Radio" & $ar). Here's an example where two guis can read the same radio boxes: #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $aArray = _FileListToArrayRec(@ScriptDir, "Setup.vbs||*_bak*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT) $top = 10 $Form1 = GUICreate("Form1", 400, 278, 192, 124) For $ar = 1 To $aArray[0] Assign("Radio" & $ar, GUICtrlCreateRadio($aArray[$ar], 10, $top, 350, 20)) $top += 30 Next GUICtrlSetState($Radio2, $GUI_CHECKED) ; Added this for easier testing $Button1 = GUICtrlCreateButton("Button1", 264, 208, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) $Form2 = GUICreate("Form2", 300, 293, 700, 218) $Button2 = GUICtrlCreateButton("read gui #1", 136, 136, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 For $ar = 1 To $aArray[0] If GUICtrlRead(Eval("Radio" & $ar)) = $GUI_CHECKED Then ; Use Eval to read the radio MsgBox(0, "", "Auswahl : " & $aArray[$ar]) $verzeichnis = "C:\scripts\" & $aArray[$ar] IniWrite(@ScriptDir & "\verzeichnis.ini", "Verzeichnis", "VBS", $verzeichnis) $verzeichnis = "C:\scripts\" & StringRegExpReplace($aArray[$ar], "\\Setup.vbs", "") IniWrite(@ScriptDir & "\verzeichnis.ini", "Verzeichnis", "Pfad", $verzeichnis) EndIf Next Case $Button2 For $ar = 1 To $aArray[0] If GUICtrlRead(Eval("Radio" & $ar)) = $GUI_CHECKED Then ; Same as $Button1 MsgBox(0, "", "Auswahl : " & $aArray[$ar]) $verzeichnis = "C:\scripts\" & $aArray[$ar] IniWrite(@ScriptDir & "\verzeichnis.ini", "Verzeichnis", "VBS", $verzeichnis) $verzeichnis = "C:\scripts\" & StringRegExpReplace($aArray[$ar], "\\Setup.vbs", "") IniWrite(@ScriptDir & "\verzeichnis.ini", "Verzeichnis", "Pfad", $verzeichnis) EndIf Next EndSwitch WEnd
    1 point
  2. kaz

    GDI+ clock

    Another GDI+ clock with google watch look. i hope you'll like it. Some code should look familiar for someone. Sorry if code isn't clean. GDI+_Clock.au3
    1 point
  3. water

    OutlookEX UDF

    Use property HTMLBody.
    1 point
×
×
  • Create New...