Hello everyone.
I just found this piece of code:
http://www.autohotkey.com/board/topic/1 ... omboboxes/
It adds atocomplete to comboboxes while you type.
The posted date is quite old, so I would like to know if a better solution has appeared since then.
Regards
Smart Comboboxes
-
- Posts: 58
- Joined: 18 Feb 2015, 15:06
Re: Smart Comboboxes
Thanks for sharing
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: Smart Comboboxes
Here is an example I have used in the past:
I slightly modified it from the example at the link to show how to make "Enter" work.
FG
Code: Select all
; http://www.autohotkey.com/board/topic/42127-combobox-help/
clients:="|Alex|Bob|Cathy|Fred|Jim|John|"
Sort,clients,D|
Gui, Add, ComboBox, gcclient vcclient w200, % clients ;Alex|Bob|Cathy|Fred|Jim|John
gui, add, text, w200 vclientname, This box Auto Fills.
Gui, Add, Button, Default x-40 y-40 gEntered,Enter
gui, show,, Client Auto Complete
return
cclient:
gui, submit, nohide
If (!GetKeyState("BackSpace","P") and cclient and pos:=InStr(clients,"|" . cclient)){
GuiControl,,clientname, % (found:=SubStr(clients,pos+1,InStr(clients,"|",1,pos+1)-pos-1))
GuiControl,Text,cclient, %found%
SendInput % "{End}" . "+{Left " . StrLen(found)-StrLen(cclient) . "}"
} else GuiControl,,clientname
return
Entered:
gui, submit
MsgBox % "You picked:`n" cclient
return
GuiClose:
GuiEscape:
exitapp
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
-
- Posts: 58
- Joined: 18 Feb 2015, 15:06
Re: Smart Comboboxes
Hello Just me,
Thank you for sharing your library. The problem with your autocomplete approach is that seems to require the identification of the control. I mean, it is not generic for any control in the gui but a specific one.
Thank you for sharing your library. The problem with your autocomplete approach is that seems to require the identification of the control. I mean, it is not generic for any control in the gui but a specific one.
Re: Smart Comboboxes
It's only a sample how to use the CB functions for auto-completion.
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: JoeWinograd and 120 guests