D�finit la valeur associ�e � l'�l�ment sp�cifi�
#include <GuiListBox.au3>
_GUICtrlListBox_SetItemData ( $hWnd, $iIndex, $iValue )
$hWnd | ID/handle du contr�le |
$iIndex | Index de l'�l�ment, compt� � partir de 0 |
$iValue | Valeur � associer � l'�l�ment |
Succ�s: | Retourne True. |
�chec: | Retourne False. |
#include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <MsgBoxConstants.au3> ; Warning this should not be used on items created using built-in functions ; Item data is the controlID for each string Example() Func Example() Local $idListBox ; Cr�e une GUI GUICreate("List Box Set Item Data", 400, 296) $idListBox = GUICtrlCreateList("", 2, 2, 396, 296) GUISetState(@SW_SHOW) ; Ajoute des cha�nes _GUICtrlListBox_BeginUpdate($idListBox) For $iI = 1 To 9 _GUICtrlListBox_AddString($idListBox, StringFormat("%03d : Random string", Random(1, 100, 1))) Next _GUICtrlListBox_EndUpdate($idListBox) ; D�finit la donn�e de l'�l�ment _GUICtrlListBox_SetItemData($idListBox, 4, 1234) ; Obtient la donn�e de l'�l�ment MsgBox($MB_SYSTEMMODAL, "Information", "Item 5 Data: " & _GUICtrlListBox_GetItemData($idListBox, 4)) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example