There is a blog post about adding autocomplete to a TextField.
What if you subclass a TextField and assign the interface, as described in the blog post, to your subclassed TextField class.
In your CellClick event, you refer to the subclass instead of referring to the TextField itself.
Not sure if it works. But theoretically, it should. Right? At least, it is worth giving it a try…
Well… That was kinda what I was talking about. I haven’t tested it, but I think you might be able to cast the ActiveCell into the subclass. If that does work, you might be able to get it working inside a ListBox.
I am not in Xojo now. I have some deadlines, and just have the forum open on my second screen, so can’t test the subclass idea myself. But just trying to pass along some ideas
LB_TE (from my code above) is a reference to the Active Cell (the TextField). I checked (useless) to set the text as Bold while editing and it works (only when editing):
LB_TE.Bold = True
Unfortunately (I think), LB_TE.Super = something cannot works: the Super keyword is colored in blue (I do not even try to run).
Still hungry, but while driving home, I had an idea:
LB_TE = AutoComplete(Me.ActiveCell)
But I got an IllegalCastException
Nota: LB_TE is Dimed as TextEdit (else: error occured), the .CellType is declared as TextField and, at last, LB_TE iSa TextField. It tooks me a while to understand that.
AutoComplete Super is TextField.
Last checking (before I start to eat):
[code] LB_TE = Me.ActiveCell
LB_TF = AutoComplete(LB_TE)[/code]
I also get an IllegalCastException
LB_TF is Dimed as TextField.