G
Guest
Hello all!
I'm looking for ideas on implementing a textbox with autocomplete
functionality, just like the one found in Excel.
As the user types values into the textbox a lookup for matching values
is performed. For example lets assume that the user types the character
'1' and that the candidate values are '01', '02', '03', '10', '12' etc.
I need the textbox to display the first candidate value that partially matches
the characters typed ('01'). The cursor should be located at the end of the
user typed value (1|0) and the rest of the text must be selected.
As the user goes on typing, the selected text is replaced with the typed
character and the lookup
is performed again.
I am very close. I use the Textbox.SelectionStart and
Textbox.SelectionLength properties but the problem is that the caret is
allways placed at the end of the selection when I need it to be located at
the begining.
Any Ideas?
Thanks!
PS: I cannot use a combobox!
I'm looking for ideas on implementing a textbox with autocomplete
functionality, just like the one found in Excel.
As the user types values into the textbox a lookup for matching values
is performed. For example lets assume that the user types the character
'1' and that the candidate values are '01', '02', '03', '10', '12' etc.
I need the textbox to display the first candidate value that partially matches
the characters typed ('01'). The cursor should be located at the end of the
user typed value (1|0) and the rest of the text must be selected.
As the user goes on typing, the selected text is replaced with the typed
character and the lookup
is performed again.
I am very close. I use the Textbox.SelectionStart and
Textbox.SelectionLength properties but the problem is that the caret is
allways placed at the end of the selection when I need it to be located at
the begining.
Any Ideas?
Thanks!
PS: I cannot use a combobox!