local $g_btn[11] for $i = 1 to 10 $g_btn[$i] = GUICtrlCreateButton("show", $x+300, $y-6, 100 ) next $msg = GUIGetMsg() select case $msg = $GUI_EVENT_CLOSE exitloop case $msg = ???? do something with button $i endselect How to I create a $msg comparison for the 10 different buttons? I would prefer not having to write 10 different versions of: case $msg = $g_btn[1] ; (and then 2,3,4...) Thanks, -John