What is conjecture input?
When we use a query application, the phrase associated with this keyword is automatically displayed under the text box after a keyword is entered for selection, saving us time for input, this is the hypothetical input, such as Baidu, Google, and so on, such:
As shown in, this effect is achieved by using TextBox of WinForm, mainly by using the AutoCompleteMode, AutoCompleteSource, and AutoCompleteCustomSource attributes of TextBox.
Detailed Parameters
AutoCompleteMode
Gets or sets the option that controls how TextBox is automatically completed.
Attribute Value
Append the remaining parts of the most likely candidate string to an existing character and highlight the appended characters.
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 disable auto-completion. This is the default value.
AutoCompleteSource gets or sets a value that specifies the source of the complete string that is automatically completed.
AutoCompleteCustomSource gets or sets the custom System. Collections. Specialized. StringCollection used when the AutoCompleteSource attribute is set to CustomSource.
For example:
Code Design
TextBoxRemind
Expand source
History
Because all data is stored, the system automatically creates a remind.txt file, which is easy to operate and easy to store.
When loading the form, initialize InitAutoCompleteCustomSource and add AutoCompleteStringCollection. When we click OK, reinitialize the data source and load the previously entered keywords.
Expand source
Last
We often encounter that Chinese characters cannot be normally displayed when StreamReader and StreamWriter are used. A simple method is to set Encoding to Default.
Attached http://www.bkjia.com/uploadfile/2011/1207/20111207052029104.zip
From aidong