I have a text box that sends some commands to the tool. I added an autocomplete function to this text box, and now everything will be easier.
What I'm going to improve is to add that when the user enters a command (just text), while autocomplete finds a match, it also shows a description for this command.
At the moment, I have all the AutoComplete lines in a text file, and I load it when the application starts. The text file contains the following lines:
*IDN?
So what happens in my application is that since AutoComplete is in SuggestAppend
mode, the command description also gets into the text box (it will be the same if I only put it in Suggest
mode)
I need to know how to get AutoComplete to add text, and its
- Does not add text starting with
#
char when adding suggested text - Trim () the text to avoid the space that you see in the source of the text file.
UPDATE 1 Well, I think the only way is to create a new class and inherit from AutoCompleteStringCollection
. And in this new class, somehow override the return method to return (add) the proposed text. I really don't know what to do:
class MyAutoCompleteCollection : AutoCompleteStringCollection { //How to override Get function of AutoCompleteStringCollection class? //It is not avilable to override :( }
UPDATE 2 I found out that methods in AutoCompleteStringCollection
are not valid. I'm looking for a way to change the way []
(to be honest, I donโt know what to call it!) Works. Does anyone know about this?
UPDATE 3 When text without #DESC falls into the text box, I have an event handler for KeyDown that will pass the command to the tool.
Saeid yazdani
source share