@rakudave I like your UDF. This is different way which allow you to set as many controls you want and have all the GUICtrlSet on one UDF.
;example
#include <GUIConstants.au3>
Dim $container1[3]
GUICreate("my gui")
$a1 = GUICtrlCreateButton("asfds",5,5)
$a2 = GUICtrlCreateButton("sdfg",25,25)
$a3 = GUICtrlCreateButton("vcmn",45,45)
$a4 = GUICtrlCreateButton("fgj",65,65)
$a5 = GUICtrlCreateButton("fgj",85,85)
$a6 = GUICtrlCreateButton("uir",105,105)
$container1[0] = $a2
$container1[1] = $a4
$container1[2] = $a6
$container2 = StringSplit($a1 & '|' & $a3 & '|' & $a5, '|')
_GUICtrlSetContainer
($container2, 'GUICtrlSetState', $GUI_HIDE)
GUISetState()
sleep(500)
_GUICtrlSetContainer
($container1, 'GUICtrlSetState', $GUI_HIDE)
_GUICtrlSetContainer
($container2, 'GUICtrlSetState', $GUI_SHOW)
sleep(500)
_GUICtrlSetContainer
($container1, 'GUICtrlSetState', $GUI_SHOW)
_GUICtrlSetContainer
($container2, 'GUICtrlSetState', $GUI_HIDE)
sleep(500)
; /example
#include-once
;===============================================================================
;
; Function Name: _GUICtrlContainer(ByRef $aCtrl, $sFunction, $Param1 = '', $Param2 = '', $Param3 = '', $Param4 = '')
; Description: Set a container for mass GUIcontrol handling
; Parameter(s): $aCtrl = an array with all control ID
; $sFunction = name of set function (guictrlsetstate, guictrlsetcolor, guictrlsetlimit, etc...)
; $Param1 to $Param4 = information need it for the called function
; Requirement(s): none
; Return Value(s): an array of called function success or failure codes
; Failure(s): return 1 if called function is not found
; return 2 when using GUICtrlSetStyle and $Param1 = ''
;
; Author(s): Danny35d
;
;===============================================================================
Func _GUICtrlSetContainer
(ByRef $aCtrl, $sFunction, $Param1 = '', $Param2 = '', $Param3 = '', $Param4 = '')
Local $ret = ''
Local $sFunctionNames = 'GUICtrlSetState|GUICtrlSetBkColor|GUICtrlSetColor|GUICtrlSetData|' & _
'GUICtrlSetCursor|GUICtrlSetFont|GUICtrlSetImage|GUICtrlSetLimit|GUICtrlSetStyle|GUICtrlSetTip'
If $aCtrl[0] <> (UBound($aCtrl) - 1) Then
ReDim $aCtrl[UBound($aCtrl) + 1]
For $x = (UBound($aCtrl) - 1) To 1 Step -1
$aCtrl[$x] = $aCtrl[$x - 1]
Next
$aCtrl[0] = UBound($aCtrl) - 1
EndIf
If StringInStr($sFunctionNames, $sFunction) == 0 Then Return(1)
$sFunction = StringLower($sFunction)
Dim $ret[$aCtrl[0] + 1]
$ret[0] = $aCtrl[0]
For $x = 1 To $aCtrl[0]
Select
Case $sFunction = 'guictrlsetbkcolor'
If $Param1 == '' Then $Param1 = 0x00ff00 ;Green
$ret[$x] = GUICtrlSetBkColor($aCtrl[$x], $Param1)
Case $sFunction = 'guictrlsetcolor'
If $Param1 == '' Then $Param1 = 0x00ff00 ;Green
$ret[$x] = GUICtrlSetColor($aCtrl[$x], $Param1)
Case $sFunction = 'guictrlsetcursor'
If $Param1 == '' Then $Param1 = 2
GUICtrlSetCursor($aCtrl[$x], $Param1)
Case $sFunction = 'guictrlsetdata'
If $Param2 == '' Then $Param2 = -1
$ret[$x] = GUICtrlSetData($aCtrl[$x], $Param1, $Param2)
Case $sFunction = 'guictrlsetfont'
If $Param1 == '' Then $Param1 = 9
If $Param2 == '' Then $Param2 = 400
If $Param3 == '' Then $Param3 = 0
If $Param4 == '' Then $Param4 = 'Arail'
$ret[$x] = GUICtrlSetFont($aCtrl[$x], $Param1, $Param2, $Param3, $Param4)
Case $sFunction = 'guictrlsetimage'
If $Param1 == '' Then $Param1 = 'Shell32.dll'
If $Param2 == '' Then $Param2 = -1
If $Param3 == '' Then $Param3 = 1
$ret[$x] = GUICtrlSetImage($aCtrl[$x], $Param1, $Param2, $Param3)
Case $sFunction = 'guictrlsetlimit'
If $Param1 == '' Then $Param1 = $aCtrl[0]
If $Param2 == '' Then $Param2 = 0
$ret[$x] = GUICtrlSetLimit($aCtrl[$x], $Param1, $Param2)
Case $sFunction = 'guictrlsetstate'
If $Param1 == '' Then $Param1 = $GUI_SHOW+$GUI_ENABLE
$ret[$x] = GUICtrlSetState($aCtrl[$x], $Param1)
Case $sFunction = 'guictrlsetstyle'
If $Param1 == '' Then Return(2)
If $Param2 == '' Then $Param2 = -1
$ret[$x] = GUICtrlSetStyle($aCtrl[$x], $Param1, $Param2)
Case $sFunction = 'guictrlsettip'
$ret[$x] = GUICtrlSetTip($aCtrl[$x], $Param1)
EndSelect
Next
Return($ret)
EndFunc