###Function###
GUICtrlRead

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

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


###Parameters###
@@ParamTable@@
controlID
	The control identifier (controlID) as returned by a <a href="GUICtrlCreate Management.htm">GUICtrlCreate...()</a> function, or -1 for the last created control.
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:	depends on the control (see below).
Failure:	0.
@@End@@

@@StandardTable1@@
<strong>Type</strong>	<strong>Value</strong>
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 in the format defined by the regional settings
Progress	Current percentage
Slider	Current value
Tab	The index of the selected tabitem (0-based)
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
ListViewItem	The text of the selected item/lines in the ListView
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 all controls return additional data!

@@StandardTable1@@
<strong>Type</strong>	<strong>Additional Value</strong>
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 and Radio controls only the $GUI_CHECKED (1), $GUI_UNCHECKED (4) or $GUI_INDETERMINATE (2) states are returned so the value can be used directly.

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. <a href="BitAND.htm">BitAND</a>(<a href="GUICtrlRead.htm">GUICtrlRead</a>($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. <a href="BitAND.htm">BitAND</a>(<a href="GUICtrlRead.htm">GUICtrlRead</a>($Item),$GUI_CHECKED) to test if the item is checked.


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


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