[已解決]求助! 編個計數器+累積計算
本帖最后由 tcpuuu 于 2010-9-11 20:42 编辑-------------------------------------------------------------------------------------------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()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $1Button
Case $2Button
Case $3Button
EndSwitch
WEnd 是这个意思?
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 嗯!很好
謝謝3mile解答!
我的問題已解決
页:
[1]