找回密码
 加入
搜索
查看: 15855|回复: 1

[交流] 为什闪退啊???问题在哪里??

[复制链接]
发表于 2013-4-1 15:40:10 | 显示全部楼层 |阅读模式
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=i:\学习资料\图形设计\3\form2.kxf
$Form1_1 = GUICreate("", 531, 442, 192, 124)
$Group1 = GUICtrlCreateGroup("信息输入", 24, 32, 481, 169)
$Input1 = GUICtrlCreateInput("", 176, 64, 73, 21)
$List1 = GUICtrlCreateList("", 350, 39, 121, 162)
$Button1 = GUICtrlCreateButton("添加", 80, 160, 65, 25)
$Button2 = GUICtrlCreateButton("重置", 184, 160, 65, 25)
$Input2 = GUICtrlCreateInput("", 80, 104, 169, 21)
$Label1 = GUICtrlCreateLabel("数量", 80, 64, 28, 17, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("结果显示", 24, 224, 481, 145)
$Label2 = GUICtrlCreateLabel("", 26, 239, 477, 128, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 36, 800, 0, "宋体")
GUICtrlSetCursor (-1, 2)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button3 = GUICtrlCreateButton("关于", 24, 384, 80, 33)
$Button4 = GUICtrlCreateButton("执行", 304, 384, 80, 33)
$Button5 = GUICtrlCreateButton("退出", 424, 384, 80, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

_main()
Exit

Func _main()
       
While 1
        Local $nMsg
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Input1
                        Local $n=GUICtrlRead($Input1)
                        Local $sz[$n]
                Case  $Button1
                       
                        Local $i=GUICtrlRead($Input2)               
                        GUICtrlSetData($List1,$i)
                        For  $n=0 To $n=GUICtrlRead($Input1)
                        $sz[$i]=$i
                        Next
                Case $Button2
                        GUICtrlSetData($Input1,"")
                        GUICtrlSetData($Input2,"")
                        GUICtrlSetData($List1,"")
                Case $Button4
                        _zhixing($sz)
                         
            Case $Button5
                    Exit
               
        EndSwitch
WEnd
EndFunc

Func _zhixing($sz)
        Local $Max = UBound($sz,1)
        Local $i
        For $i = 1 To 30
                Local $sj= Random(1, $Max,1)
                Local $jg= $sz[$sj]
                Sleep(100)
                GUICtrlSetData($Label2, $jg)
        Next
EndFunc
发表于 2013-4-1 20:51:44 | 显示全部楼层
声明变量不够严谨
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-5 03:12 , Processed in 0.073608 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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