Recherche un �l�ment qui contient le texte sp�cifi� n'importe o� dans son texte
#include <GuiListBox.au3>
_GUICtrlListBox_FindInText ( $hWnd, $sText [, $iStart = -1 [, $bWrapOK = True]] )
$hWnd | ID/handle du contr�le |
$sText | Texte dont il faut chercher une correspondance |
$iStart | [optionnel] Index de l'�l�ment, compt� � partir de 0, sur lequel commence la recherche ou -1 pour commencer au d�but. L'�l�ment sp�cifi� est lui-m�me exclu de la recherche. |
$bWrapOK | [optionnel] Si True, la recherche se poursuivra avec le premier �l�ment si aucune correspondance n'est trouv�e |
Succ�s: | Retourne l'index de l'�l�ment, compt� � partir de 0. |
�chec: | Retourne -1. |
La recherche est insensible � la casse.
_GUICtrlListBox_FindString, _GUICtrlListBox_SelectString
#include <GUIConstantsEx.au3> #include <GuiListBox.au3> Example() Func Example() Local $iIndex, $idListBox ; Cr�e une GUI GUICreate("List Box Find In Text", 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_InsertString($idListBox, "eXaCt tExT", 3) _GUICtrlListBox_EndUpdate($idListBox) ; Cherche un �l�ment $iIndex = _GUICtrlListBox_FindInText($idListBox, "exa") _GUICtrlListBox_SetCurSel($idListBox, $iIndex) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example