I am using ScintillaNET
to make a basic IntelliSense editor. However, I have a problem when I call _editor.CallTip.Show("random text")
in the AutoCompleteAccepted
Event.
If I type pr
for example, and scroll and select printf
in the drop-down list, it goes to my AutoCompleteAccepted
event and when I call the CallTip.Show, the rest of the word does not get added (however, without that CallTip code, the rest of the word is filled).
So, if I typed pr
then it stays pr
and I get my CallTip. How do I make sure the rest of the word gets inserted AND the CallTip shows?
Is the AutoCompleteAccepted
Event not the right place to call it? If so, where should I call the CallTip.Show so that it works side-by-side with my AutoComplete?
Finally figured it out! The
AutoCompleteAccepted
Event isn't the right place to put CallTip.ShowWhat is going on is the fact that when
AutoCompleteAccepted
Event is called and you add text to the ScintillaNET control, it takes time for the UI to update and so, when you call to show the CallTip, it interferes with the text being inserted into the control.The better way to do it is to call CallTip.Show in the
TextChanged
event, as they you know that the text has been inserted when theAutoCompleteAccepted
Event was called.It would now look something like this:
That is essentially what can be done to ensure the AutoComplete fills correctly and you get the CallTip to show.
Just note, that the CallTip MAY end up in unintended places, so it is recommended to set the value of where you want the CallTip to show up