Product: Powershell Studio v5.6.163 64 bit
OS: W10 64 bit
Default functionality for a combobox autocomplete is to only register on prefixes, or -StartsWith. What I'm trying to find out is if there's a way to modify how it reads/matches against the combobox's items to where it functions more like -Contains, where the typed string can match anywhere within each item.
For instance, if I have the strings "Control", "Freedom", and "Dominate" in my combobox with autocomplete on and type "dom", the combobox will suggest:
"Dominate"
I would like it to suggest:
"Freedom"
"Dominate"
Is this possible?
Changing autocomplete behavior on combobox
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Changing autocomplete behavior on combobox
No. The ComboBox only matches based on the string match. Any other method would require you to write custom code to handle keystrokes and decide how to use them in a match.
You can also use an object collection that has a display string and a value. Make the display strings match-able and set the return value to the actual value you want.
You can also use an object collection that has a display string and a value. Make the display strings match-able and set the return value to the actual value you want.
Re: Changing autocomplete behavior on combobox
Thanks for the reply, jvierra.
I'm already midway through writing my own _KeyPress event, but I just wanted to ask you guys before I got too deeply involved in it. Good to know that my current path is probably the best one.
Cheers
I'm already midway through writing my own _KeyPress event, but I just wanted to ask you guys before I got too deeply involved in it. Good to know that my current path is probably the best one.
Cheers