hey guys
i wanted to make an autocomplete textbox, n i thought the best idea would be to update the content of a listbox as i change the contents of a textbox. So, how can i create the event when the content of the textbox/editbox is changed?
autocomplete textbox
Started by
Ronins
, May 20 2012 08:53 AM
7 replies to this topic
#1
Posted 20 May 2012 - 08:53 AM
#2
Posted 20 May 2012 - 09:26 AM
If you're going to create a GUI with AHK, there is 'G-label' which will intercept user input.
#3
Posted 20 May 2012 - 10:32 AM
ok thanx, i plan to use a text file to get the contents of the listbox. When the user types any character, the contents will be updated. Updated as in, suppose user types "a". All the texts starting with a will be displayed. Then user types "ab". Then the listbox will repopulate, and then contents starting with "ab" will be displayed. This seems to be a slow and long process. Anyone got any other idea regarding this?
#4
Posted 20 May 2012 - 01:56 PM
like this?
list = Red|Green|Blue|Black|White ; needs to be in a variable so we can revert to it easily
Gui, Add, Edit, x5 vName gAutoComplete,
Gui, Add, ListBox, x5 vColorChoice r6, %list%
Gui, Show
return
AutoComplete:
Gui, submit, nohide
loop, parse, list, | ; parse the list to see if the name is in it
{
if A_LoopField contains %name%
newlist .= A_LoopField . "|" ; populate the new list
}
if newlist =
newlist := list
GuiControl,, ColorChoice, |%newlist% ; by starting with | it'll replace the list in total
newlist := ; to clear the variable for population later on
return
#5
Roninz
Posted 20 May 2012 - 02:27 PM
Yea, somewhat lyk that.. Prob is, m nt talking about 5 or 6 words here.. M talking about a lot more, so execution would become slow.
#6
Posted 20 May 2012 - 03:27 PM
SetBatchLines -1is your friend
I think it'd have to become quite large (like 10000+) before it becomes noticeably slow...
#7
Roninz
Posted 20 May 2012 - 03:33 PM
Ya.. I just filled a textfile with about 100 lines. Then also it wasnt slow. Used scripts to check out the working time. Delay was about 5 millisecs. Still good enough for me. Thx bro
#8
Posted 20 May 2012 - 03:50 PM
no worries, glad I could help.




