本帖最后由 smooth 于 2010-11-9 08:26 编辑
Button3是退出,于Button2是执行。如果直接点击于Button3,不弹出MsgBox的内容直接退出程序,
如果点击Button3之前点击一下Button2,则Button3对应的MsgBox能弹出来,尽管有缺陷。
各位老师,为什么点击Button3,会依赖于Button2呢?他们是位于不同的case之下的呀。谢谢。While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If MsgBox(1, "温馨提示", "退出程序并访问鼎盛中国网站吗?") = 1 Then
shellexecute("Http://hi.baidu.com/cnace")
_UnLoadSkin($hSkinDll)
Exit
EndIf
Case $Button1
_CheckboxOpt($Checkbox, $Button1, 2)
Case $Button2
Dim $s = 0
For $c = 1 To 20
If GUICtrlRead($Checkbox[$c]) = $GUI_CHECKED Then
$s = 1
ExitLoop
EndIf
Next
If $s = 0 Then
$Msg = MsgBox(0, "温馨提示", "您未选择任何项目,请选择要执行的项目后再操作!")
Else
_main()
For $i=1 To 20
GUICtrlSetState($Checkbox[$i],$GUI_UNCHECKED)
; GUICtrlSetState($Checkbox[$i],$GUI_DISABLE)
Next
If MsgBox(1,"温馨提示", "系统清理完成,要退出程序并访问鼎盛中国网站吗?") = 1 Then
shellexecute("Http://hi.baidu.com/cnace")
_UnLoadSkin($hSkinDll)
EXIT
EndIf
EndIf
Case $Button3
Dim $sum,$s = 0
For $c = 1 To 20
If GUICtrlRead($Checkbox[$c]) = $GUI_CHECKED Then
$s = 1
$Sum = $Sum + $s
EndIf
Next
If $sum = 0 Then
If $Msg = MsgBox(1, "温馨提示", "您未执行任何操作,确定退出程序吗?") = 1 Then
_UnLoadSkin($hSkinDll)
Exit
EndIf
ElseIf $Sum = 20 Then
If $Msg = MsgBox(1, "温馨提示", "您已选择所有项目但未执行,确定退出程序吗?") = 1 Then
_UnLoadSkin($hSkinDll)
Exit
EndIf
Else
If MsgBox(1, "温馨提示", "您已选择一些项目但未执行,确定退出程序吗?") = 1 Then
_UnLoadSkin($hSkinDll)
Exit
EndIf
EndIf
EndSwitch
WEnd
|