是这个意思?
GUICreate("計數器", 70, 190, 928, 2)
$L1 = GUICtrlCreateInput("", 1, 1, 68, 26, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L2 = GUICtrlCreateInput("", 1, 84, 68, 26, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L3 = GUICtrlCreateInput("", 1, 150, 68, 26, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
;----------------------------------------------------------
$L4 = GUICtrlCreateInput("", 0, 68, 70,3, 0x00800000)
GUICtrlSetBkColor(-1, 0xFF0000)
;----------------------------------------------------------
$1Button = GUICtrlCreateButton("計數", 2, 32, 32, 24)
$2Button = GUICtrlCreateButton("歸0", 36, 32, 32, 24)
$3Button = GUICtrlCreateButton("累積計算", 4, 114, 62, 32)
;----------------------------------------------------------
GUISetState()
Local $edit=0
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $1Button
$edit+=1
GUICtrlSetData($L1,$edit)
Case $2Button
$edit=0
GUICtrlSetData($L1,"")
Case $3Button
$edit2=GUICtrlRead($L2)
$edit3=GUICtrlRead($L3)
GUICtrlSetData($L3,$edit2+$edit3)
GUICtrlSetData($L2,"")
EndSwitch
WEnd
|