#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
Local $hGUI = GUICreate("Простой графический компонент на autoit",500,500)
Local $idInput_1 = GUICtrlCreateLabel("0", 40, 30, 25, 20)
Local $value = 0
Local $plus= GUICtrlCreateButton("+", 10, 25,15,25)
Local $minus= GUICtrlCreateButton("-", 65, 25,15,25)
GUISetState(@SW_SHOW, $hGUI)
While 1
$msg = GUIGetMsg()
if $msg = $GUI_EVENT_CLOSE then
ExitLoop
endif
if $msg = $plus then
$value = $value + 1
GUICtrlSetData($idInput_1,"")
GUICtrlSetData($idInput_1,$value )
endif
if $msg = $minus and $value > 0 then
$value = $value - 1
GUICtrlSetData($idInput_1,"")
GUICtrlSetData($idInput_1,$value )
endif
WEnd
|