Код:
#include <ButtonConstants.au3>
#include <GuiButton.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("TrayIconDebug", 1)
#Region
$Form1 = GUICreate("Метадатер", 938, 290, 192, 124)
$Button1 = GUICtrlCreateButton("КНОПКА 1", 8, 8, 185, 41)
;GUICtrlSetFont(-1, 12, 400, 0, "Days")
$Button2 = GUICtrlCreateButton("КНОПКА 2", 200, 8, 177, 41)
;GUICtrlSetFont(-1, 12, 400, 0, "Days")
$Button3 = GUICtrlCreateButton("КНОПКА 3", 384, 8, 177, 41)
;GUICtrlSetFont(-1, 12, 400, 0, "Days")
$Button4 = GUICtrlCreateButton("КНОПКА 4", 568, 8, 177, 41)
;GUICtrlSetFont(-1, 12, 400, 0, "Days")
$Button5 = GUICtrlCreateButton("КНОПКА 5", 752, 8, 177, 41)
;GUICtrlSetFont(-1, 12, 400, 0, "Days")
$Button6 = GUICtrlCreateButton("КНОПКА 6", 8, 248, 921, 33)
;GUICtrlSetFont(-1, 15, 400, 0, "Days")
$Button7 = GUICtrlCreateButton("КНОП 1", 8, 56, 225, 25)
;GUICtrlSetFont(-1, 10, 400, 0, "Days")
$Button8 = GUICtrlCreateButton("КНОП 2", 8, 88, 225, 25)
;GUICtrlSetFont(-1, 10, 400, 0, "Days")
$Button9 = GUICtrlCreateButton("КНОП 3", 8, 120, 225, 25)
;GUICtrlSetFont(-1, 10, 400, 0, "Days")
$Button10 = GUICtrlCreateButton("КНОП 4", 8, 152, 225, 25)
;GUICtrlSetFont(-1, 10, 400, 0, "Days")
$Button11 = GUICtrlCreateButton("КНОП 5", 8, 184, 225, 25)
;GUICtrlSetFont(-1, 10, 400, 0, "Days")
$Button12 = GUICtrlCreateButton("КНОП 6", 8, 216, 225, 25)
;GUICtrlSetFont(-1, 10, 400, 0, "Days")
GUISetState(@SW_SHOW)
#EndRegion
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button1
_GUICtrlButton_SetState($Button1,True)
_GUICtrlButton_SetState($Button2,False)
_GUICtrlButton_Show($Button7,True)
_GUICtrlButton_Show($Button8,True)
_GUICtrlButton_Show($Button9,True)
_GUICtrlButton_Show($Button10,True)
_GUICtrlButton_Show($Button11,True)
_GUICtrlButton_Show($Button12,True)
Case $Button2
_GUICtrlButton_SetState($Button2,True)
_GUICtrlButton_SetState($Button1,False)
_GUICtrlButton_Show($Button7,False)
_GUICtrlButton_Show($Button8,False)
_GUICtrlButton_Show($Button9,False)
_GUICtrlButton_Show($Button10,False)
_GUICtrlButton_Show($Button11,False)
_GUICtrlButton_Show($Button12,False)
Case $GUI_EVENT_CLOSE
Exit
sleep(20)
EndSwitch
WEnd
По идее переключаясь между кнопками $Button1 и $Button2 скрипт должен их последовательно подсвечивать и гасить, а на деле выходит что нужно 2 раза на кнопку нажимать, почему так и как этого избежать?