question

Hobbyistprogrammer-7674 avatar image
0 Votes"
Hobbyistprogrammer-7674 asked Hobbyistprogrammer-7674 commented

Textbox Show auto-complete items on mouse enter?

Hallo,

Is there a way to show auto complete items on mouse enter ?. It works when i type the first letter but i want it when i put the cursor on the textbox. is it possible?

Thanks

dotnet-visual-basic
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Hobbyistprogrammer-7674 ,
You can consider prefixing all auto-complete items with a space so that you can type space to see all the items.
Also take a look at : How to make autocomplete on a TextBox show suggestions when empty


0 Votes 0 ·
Castorix31 avatar image
0 Votes"
Castorix31 answered Hobbyistprogrammer-7674 commented

It can be done by using directly IAutoComplete2 interface with ACO_UPDOWNKEYDROPSLIST flag
Then you can simulate Key Down for example to show the list
I tested on Set Focus , but you can do it on Mouse enter or any other event =>

81832-autocomplete.gif



autocomplete.gif (15.0 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you please provide a sample code? thanks.

0 Votes 0 ·
Castorix31 avatar image Castorix31 Hobbyistprogrammer-7674 ·

A test with IAutoComplete2 and MouseEnter event (add a TextBox)
(when an item has been chosen, it displays sometimes an empty list, not sure if it is normal...)

I cannot post code in Comments : IAutoComplete2 Test


0 Votes 0 ·
karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered

Hello,

A TextBox setup for autocomplete does not have a method and event to display the autocomplete list on mouse event. You would have to write a custom TextBox which would be a good deal of work to accomplish what you are asking for.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.