Aide:GUICtrlRead.txt

De Wiki AutoIt Français
Aller à : navigation, rechercher

Document original V3.3.6.1 :

###Function###
GUICtrlRead

###Description###
Read state or data of a control.

###Syntax###
GUICtrlRead ( controlID [, advanced] )


###Parameters###
@@ParamTable@@
controlID
	The control identifier (controlID) as returned by a <a href="GUICtrlCreate Management.htm">GUICtrlCreate...</a> function.
advanced
	[optional] returns extended information of a control.
	0 = (Default) Returns a value with state or data of a control.
	1 = Returns extended information of a control (see Remarks).
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	Returns depending the control (see below).
Failure:	Returns 0.
@@End@@

@@StandardTable1@@
<b>Type</b>	<b>Value</b>
Checkbox, Radio	state of the button. <a href="GUICtrlSetState.htm#StateTable">See State table</a>
Combo, List	The value selected
Input, Edit	The text entered
Button	The display text
Date	The selected date
Progress	Current percentage
Slider	Current value
Tab	The number or the controlID of the tabitem selected depending of the advanced parameter value.
Menu, MenuItem	State of the menu/item. <a href="GUICtrlSetState.htm#StateTable">See State table </a>
TreeView	Control identifier (controlID) of the selected TreeViewItem
TreeViewItem	State of the TreeViewItem
ListView	Control identifier (controlID) of the selected ListViewItem. 0 means no item is selected
Dummy	The value set by <a href="GUICtrlSendToDummy.htm">GUICtrlSendToDummy</a> or <a href="GUICtrlSetData.htm">GUICtrlSetData</a>
@@End@@


###Remarks###
In 'advanced' mode the return value contains additional data of the control (see below).

Note: not for all known controls there is additional data available!
<br>
@@StandardTable1@@
<b>Type</b>	<b>Additional Value</b>
Checkbox, Radio	The text of the control.
Menu, MenuItem	The text of the control.
TreeView	The text of the current selected TreeViewItem.
TreeViewItem	The text of the TreeViewItem.
ListViewItem	The state of the ListViewItem if $LVS_EX_CHECKBOXES exStyle used in advanced mode.  <a href="GUICtrlSetState.htm#StateTable">See State table </a>
Tab	The controlID of the tabitem selected
@@End@@

For Checkbox, Radio control several states can be returned as $GUI_FOCUS and $GUI_CHECKED,. So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the control is checked.

For Listview items several states can be returned as $GUI_CHECKED and $GUI_UNCHECKED (only for listview controls with LVS_EX_CHECKBOXES-exstyle and on 'advanced' return) . So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the item is checked.

For Treeview items several states can be returned as $GUI_FOCUS, $GUI_EXPAND and $GUI_CHECKED, $GUI_UNCHECKED (only for treeview controls with TVS_CHECKBOXES-style . So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the item is checked.


###Related###
GUICtrlUpdate..., GUIGetMsg, GUICtrlSetData, GUIEventOptions (Option), GUICtrlCreate..., GUICtrlGetState, GUICtrlSendToDummy, GUICtrlSendMsg


###Example###
@@IncludeExample@@


Document traduit V3.3.6.1 :

Texte en Français


Traducteur :

Contributeurs (pour les modifications avant le Wiki) :