
スペースバーを押しても、カウントアップします。
コード
#include
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Count", 214, 161, 187, 132)
GUISetFont(14, 400, 0, "Meiryo UI")
$Button1 = GUICtrlCreateButton("0", 40, 16, 121, 41)
$Button2 = GUICtrlCreateButton("Reset", 40, 88, 121, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{SPACE}","_pulas_1") ;スペースキーでもカウント
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1 ;// ボタン1で+カウント
$tmp = GUICtrlRead($Button1)+1
GUICtrlSetData($Button1,$tmp)
Case $Button2 ;// ボタン2でリセット
GUICtrlSetData($Button1,"0")
EndSwitch
WEnd
Func _pulas_1()
$tmp = GUICtrlRead($Button1)+1
GUICtrlSetData($Button1,$tmp)
EndFunc
スペースバーでもカウント増加します。
5個のカウンターボタンを作る(真似る)

KodaというソフトでGUIを簡単に作ります。
このソフトを便利なのでアイディア真似てみたいと思います。

同じGUIはLOOPで作るとはやい
(1)FD-GUIでラベル・ボタンを一組作りAU3のコードにします。

(2)そのコードをLOOPで回します。
#include <GUIConstantsEx.au3>
GUICreate("test")
For $i=0 to 9
$Label1 = GUICtrlCreateLabel($i+1, 48, 32*$i, 37, 16)
$Button1 = GUICtrlCreateButton("Button" & $i, 104, 32*$i, 105, 25)
$Input1 = GUICtrlCreateInput("Input" & $i, 240, 32*$i, 89, 20)
Next
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()
これで次の画像のようになります。

まだ、先は長い

コメント