Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6999347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:31:46+00:00 2026-05-27T20:31:46+00:00

I have a textbox which sends some commands to an instrument. I added the

  • 0

I have a textbox which sends some commands to an instrument. I added the AutoComplete feature to this textbox and things are going easier now.

What I am thinking to improve this, is to add a possibility that when user enters a command (just a text) while AutoComplete finds a match it also shows a description for that command.

At the moment, I have all the AutoComplete strings in a text file and I load it when the application starts. The textfile contains lines like this:

*IDN?   #Query the instrument for identification
*RST    #Resets the instrument

So what is happening in my application is that because AutoComplete is in SuggestAppend mode, the description of command also gets into the textbox (this will be the same if I only put it in Suggest mode)

What I need to know is how to force the AutoComplete to append the text while its

  1. Does not add any text starting from # char while appending the suggested text
  2. Trim() the text to avoid that spaces you see in the textfile source

UPDATE 1
Ok, I think the only way is to make a new class and inherit from AutoCompleteStringCollection And in this new class, somehow override the reponsible method for returning (appending) suggested text. I really have no idea what should I 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 AutoCompleteStringCollectionare not overridable. I am looking for a way to change the way the [] method (to be honest I do not know what to call it!) works. Does someone have any idea about this?

enter image description here

UPDATE 3
When the text without #DESC goes into the textbox, I have a event handler for KeyDown which will transfer the command to the instrument.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:31:47+00:00Added an answer on May 27, 2026 at 8:31 pm

    Rather than trying to battle the autocomplete functionality that Microsoft has implemented, I strongly suggest that you use a multi-column combobox instead.

    All of the ones that we have used support auto-completion, so you can store your command in the first column and have it be your value and then store your description in the second column.

    There are a tremendous number of controls available for purchase (Infragistics, Intersoft, Syncfusion, etc) and you can probably find free or self-built versions on various sites such as CodeProject.

    Going this route should save you a lot of time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which has a single textbox that sends some data to
I have some C# / asp.net code I inherited which has a textbox which
I have a textbox which accepts Minutes. This value will be stored in a
I have a textbox which is extended by an Ajax Control Toolkit calendar. I
Desktop window application. I have textbox in which user give values in numbers. what
I have my own textbox which inherits System.Windows.Forms.TextBox I am trying to display texts
I have a web form where I have a textbox in which the user
I have TextBox (multiline) and Label in an UpdatePanel which I refresh with javascript
I have a WPF TextBox in which I want to allow autocompleting user names
I have an asp.net TextBox in which I want to check if the text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.