Hello,
I am trying to make a autocomplete into a Textfield but I have a problem with the highlighted text.
So when I type letters, a word is proposed and when I type on the horizontal tab touch (Ascii 9) the proposed word is accepted.
But that word is highlighted so when I want to keep typing the word is removed.
So my question is to know how to remove that highlight.
Thank you.
BB
Set .SelLength
to 0 ?
TextEdit.SelLength
You press the Tab Key to accept the proposed word and then want to continue the typing ?
Isn’t it wrong thinking ?
That’s right Emile I press the Tab Key to accept the proposed word and then I continue the typing.
I agree with you I had the same code :
me.SelStart = Len(Texte_Def)
me.SelLength = 0
But I put it in the keyDown event, maybe it is wrong.
My text remains highlighted.
BR
Yes I do, it works for one word but not for several except if I well found and understood everything, what is likely.
My only problem is to deactivate the highlight to continue my sentence.
[quote=373511:@BenotBouillon]But I put it in the keyDown event, maybe it is wrong.
My text remains highlighted.[/quote]
You have to return true or the text is re-highlighted.
If asc(key) = 9 Then
Me.SelLength = 0
Me.SelStart = Me.Text.Len
Return True
End If
Yesss it works.
Thank you very much Julian. So many time spent for 2 words.
I always forget that Return True