Valnurat Posted February 19, 2018 Posted February 19, 2018 I have a ComboBox and I want, when I start writting in it, that it will show me what is the first in the list. Like, is I start writting: "pe" it should show me "peter" if that is the first in the list. How can I do that? While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClos ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) Local $iIdx = _ArraySearch($aResult,$sComboRead,0,0,0,0,1,1) Local $aComputerOwner = _AD_GetObjectsInOU("OU=al,DC=AD,DC=AL,DC=ORG","(&(objectclass=computer)(managedby=" & $aResult[$iIdx][0] & "))",Default,"cn") _ArrayDelete($aComputerOwner,0) _GUICtrlListView_SetItemCount($idMylist,UBound($aComputerOwner)) If IsArray($aComputerOwner) Then For $i = 0 To UBound($aComputerOwner) - 1 GUICtrlCreateListViewItem($aComputerOwner[$i], $idMylist) Next Else GUICtrlSetData($idMylist, "No computer|") EndIf EndSwitch WEnd Yours sincerely Kenneth.
Zedna Posted February 19, 2018 Posted February 19, 2018 Look at _GUICtrlComboBox_AutoComplete() Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted February 19, 2018 Posted February 19, 2018 Just BIG speed optimization of your script --> not needed _ArrayDelete(): ;~ Local $aComputerOwner = _AD_GetObjectsInOU("OU=al,DC=AD,DC=AL,DC=ORG","(&(objectclass=computer)(managedby=" & $aResult[$iIdx][0] & "))",Default,"cn") ;~ _ArrayDelete($aComputerOwner,0) ;~ _GUICtrlListView_SetItemCount($idMylist,UBound($aComputerOwner)) ;~ If IsArray($aComputerOwner) Then ;~ For $i = 0 To UBound($aComputerOwner) - 1 ;~ GUICtrlCreateListViewItem($aComputerOwner[$i], $idMylist) ;~ Next ;~ Else ;~ GUICtrlSetData($idMylist, "No computer|") ;~ EndIf Local $aComputerOwner = _AD_GetObjectsInOU("OU=al,DC=AD,DC=AL,DC=ORG","(&(objectclass=computer)(managedby=" & $aResult[$iIdx][0] & "))",Default,"cn") _GUICtrlListView_SetItemCount($idMylist,UBound($aComputerOwner)-1) If IsArray($aComputerOwner) Then For $i = 1 To UBound($aComputerOwner) - 1 ; skip first item with index 0 (number of rows in array) GUICtrlCreateListViewItem($aComputerOwner[$i], $idMylist) Next Else GUICtrlSetData($idMylist, "No computer|") EndIf Resources UDF ResourcesEx UDF AutoIt Forum Search
Valnurat Posted February 20, 2018 Author Posted February 20, 2018 Great. Thank you. How can I use "Enter" on my ComboBox as I do with my mouse? Yours sincerely Kenneth.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now