GUICtrlGetState
获取控件的当前状态.
GUICtrlGetState ( controlID )
参数
返回值
备注
与 GUICtrlRead() 不同, 本函数仅返回控件状态:
enabled = 激活
disabled = 禁用
hidden = 隐藏
show = 显示
dropaccepted = 接受拖放
例外:
对于 ListView 控件, 本函数将返回点击的列号.
相关
GUICtrlRead, GUICtrlSetState
函数示例
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
GUICreate("My GUI (GetControlState)")
Local $idCheckbox = GUICtrlCreateCheckbox("checkbox", 10, 10)
GUICtrlSetState(-1, 1) ; checked
GUISetState(@SW_SHOW) ; will display an empty dialog box
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
MsgBox($MB_SYSTEMMODAL, "state", StringFormat("GUICtrlRead=%d\nGUICtrlGetState=%d", GUICtrlRead($idCheckbox), GUICtrlGetState($idCheckbox)))
EndFunc ;==>Example
----------------------------------------
|