找回密码
 加入
搜索
查看: 1900|回复: 2

[GUI管理] [已解決]求助! 編個計數器+累積計算

[复制链接]
发表于 2010-9-9 19:33:48 | 显示全部楼层 |阅读模式
本帖最后由 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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-9-9 20:29:17 | 显示全部楼层
是这个意思?
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

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

 楼主| 发表于 2010-9-9 21:17:42 | 显示全部楼层
嗯!  很好
謝謝  3mile  解答!

我的問題已解決
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-9 09:38 , Processed in 0.089002 second(s), 29 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表