Ajoute une cha�ne
#include <GuiListBox.au3>
_GUICtrlListBox_AddString ( $hWnd, $sText )
$hWnd | ID/handle du contr�le |
$sText | Cha�ne qui doit �tre ajout�e |
Succ�s: | Retourne l'index de la cha�ne, compt� � partir de 0. |
�chec: | Retourne -1. |
Si l'espace est insuffisant pour stocker la nouvelle cha�ne, la valeur de retour est $LB_ERRSPACE.
Si la ListBox n'a pas le style $LBS_SORT, la cha�ne est ajout�e � la fin de la liste.
Sinon, la cha�ne est ins�r� dans la liste et la liste est tri�e.
_GUICtrlListBox_AddFile, _GUICtrlListBox_DeleteString, _GUICtrlListBox_InitStorage, _GUICtrlListBox_InsertString
#include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <WindowsConstants.au3> Example() Func Example() Local $idListBox ; Cr�e une GUI GUICreate("List Box Add String", 400, 296) $idListBox = GUICtrlCreateList("", 2, 2, 396, 296, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_DISABLENOSCROLL, $WS_HSCROLL)) 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_InsertString($idListBox, "Exact teXt", 3) _GUICtrlListBox_InsertString($idListBox, "This is the string that we're looking for", 6) _GUICtrlListBox_InsertString($idListBox, _ "Let's add one really long line of text so that we can set the horizontal scroll bar and " & _ "show that, unless we dynamically update the scroll bar, it won't show the full line.", 9) _GUICtrlListBox_UpdateHScroll($idListBox) _GUICtrlListBox_EndUpdate($idListBox) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example