sandin Posted December 6, 2008 Share Posted December 6, 2008 if I have an array control, how can I detect current array that has been clicked? example script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 164, 253, 193, 125) dim $checkbox1[11] dim $checkbox2[11] $height = 10 for $i = 1 to 10 $checkbox1[$i] = GUICtrlCreateCheckbox("", 5, $height, 17, 17) $height += 17 Next $height = 10 for $i = 1 to 10 $checkbox2[$i] = GUICtrlCreateCheckbox("", 45, $height, 17, 17) _check_checkbox($checkbox2[$i], $checkbox1[$i]) $height += 17 Next GUISetState(@SW_SHOW) func _check_checkbox($i_chk2, $i_chk1) if GUICtrlRead($i_chk1) = $GUI_CHECKED Then GUICtrlSetState($i_chk2, $GUI_ENABLE) Else GUICtrlSetState($i_chk2, $GUI_DISABLE) endif EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $checkbox1[1] to $checkbox1[10] _check_checkbox($checkbox2[$i], $checkbox1[$i]) ;<--- what should I type here? How could I retrieve $i (curent array)? EndSwitch WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
sandin Posted December 6, 2008 Author Share Posted December 6, 2008 sry, solved #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 164, 253, 193, 125) dim $checkbox1[11] dim $checkbox2[11] $height = 10 for $i = 1 to 10 $checkbox1[$i] = GUICtrlCreateCheckbox("", 5, $height, 17, 17) $height += 17 Next $height = 10 for $i = 1 to 10 $checkbox2[$i] = GUICtrlCreateCheckbox("", 45, $height, 17, 17) _check_checkbox($checkbox2[$i], $checkbox1[$i]) $height += 17 Next GUISetState(@SW_SHOW) func _check_checkbox($i_chk2, $i_chk1) if GUICtrlRead($i_chk1) = $GUI_CHECKED Then GUICtrlSetState($i_chk2, $GUI_ENABLE) Else GUICtrlSetState($i_chk2, $GUI_DISABLE) endif EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $checkbox1[1] to $checkbox1[10] _check_checkbox($checkbox2[$nMsg-2], $checkbox1[$nMsg-2]) EndSwitch WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now