C # automatic prompt, Automatic completion, and automatic completion in the TextBox input box,
Function Overview
Related attributes
TextBox. AutoCompleteCustomSource attributes
Gets or sets the custom T: System. Collections. Specialized. StringCollection to be used when the TextBox. AutoCompleteSource attribute is set to [CustomSource.
TextBox. AutoCompleteMode attribute
Gets or sets an option, which controls the method that is automatically applied to TextBox.
Attribute Value
Type: System. Windows. Forms. AutoCompleteMode
One of the AutoCompleteMode values. These values are as follows.
Append
Append the rest of the most likely candidate string to an existing character and highlight the appended character.
Suggest
Displays the secondary drop-down list associated with the editing control. This drop-down list is filled with one or more recommended completion strings.
SuggestAppend
Append the Suggest and Append options.
None
Automatic completion is disabled. This is the default value.
TextBox. AutoCompleteSource attributes
Gets or sets a value that specifies the source of the complete string that is automatically completed.
Remarks
You can use the AutoCompleteCustomSource, AutoCompleteMode, and AutoCompleteSource attributes to create a TextBox. It automatically completes the input string by comparing the entered prefix with the prefix of all strings in the maintained source. This is useful for TextBox controls that frequently contain URLs, addresses, file names, or command input.
AutoCompleteCustomSource is optional, but you must set the AutoCompleteSource attribute to CustomSource before using AutoCompleteCustomSource.
The AutoCompleteMode and AutoCompleteSource attributes must be used together.
Sample Code
The following code example demonstrates how to use a set as a TextBox Control to automatically complete a custom source.
In this example, the following operations are performed:
Use the AutoCompleteSource attribute to enable the TextBox Control to accept custom sources for its Automatic completion behaviors.
Use the AutoCompleteCustomSource attribute to set the custom list of values.
Use the AutoCompleteMode attribute to set the Automatic Display Mode of the candidate.
Reproduced http://blog.csdn.net/testcs_dn/article/details/45293253#t2