本帖最后由 天堂泪吻泪 于 2009-7-8 22:18 编辑 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
$Form1 = GUICreate("复选框实例", 476, 277, 193, 125)
$drivers = GUICtrlCreateCheckbox("drivers", 136, 56, 97, 17)
$Button1 = GUICtrlCreateButton("确定", 112, 152, 75, 25, 0)
$Button2 = GUICtrlCreateButton("关闭", 216, 152, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If GUICtrlRead($drivers)=1 Then
MsgBox(64,"复选框实例",$drivers&"被中!")
Else
MsgBox(64,"复选框实例",$drivers&"未被中!")
EndIf
Case $Button2
Exit
EndSwitch
WEnd
帮助里是这样的
[
返回值
成功: 返回控件标识符(控件ID)。
失败: 返回值为0。
]
复选框的值为什么会是“3”,有点搞不懂!可不可以是其他的值,如"drivers"??
问题已经解决了!谢谢4楼,真是感谢万分! |