Skip to content

Commit a6ff652

Browse files
authored
Update README.md
1 parent 0f8f837 commit a6ff652

File tree

1 file changed

+34
-37
lines changed

1 file changed

+34
-37
lines changed

README.md

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,59 @@
11
# Winforms-AutoComplete-Examples
2-
The WinForms Autocomplete component allows users to enable autocompletion functionality for any edit control. Multiple columns with a header in the autocomplete pop-up provide information for each matching entry. Its rich, built-in feature set includes different autocompletion modes such as suggest and append, appearance customization, and more. For more details please refer [What is winforms AutoComplete](https://www.syncfusion.com/kb/1086/what-is-the-autocomplete-control).
2+
## Overview
3+
The WinForms AutoComplete component allows users to enable autocomplete functionality to edit controls. It supports multi-column suggestions with headers, multiple modes (Suggest, Append, SuggestAppend), and rich appearance customization. See What is WinForms AutoComplete for details: https://www.syncfusion.com/kb/1086/what-is-the-autocomplete-control
34

45
## AutoComplete Modes
5-
* Suggest: Displays suggestion in drop-down list.
6-
6+
* Suggest: Shows suggestions in a drop-down list.
7+
78
![Autocomplete Suggest](AutoComplete-Images/autocomplete_autosuggest.png)
8-
9-
* Append: Appends the first suggestion to text.
10-
9+
* Append: Appends the best match to the typed text.
10+
1111
![Autocomplete Append](AutoComplete-Images/autocomplete_autoappend.png)
12-
13-
* SuggestAppend: Performs both the above ways.
14-
12+
* SuggestAppend: Combines Suggest and Append.
13+
1514
![AutoComplete Suggest Append](AutoComplete-Images/autocomplete_both.png)
1615

17-
## DataSource
18-
Sets the Datasource to the Autocomplete component. The AutoComplete component automatically picks the "History Data List" mode or "Data source" mode based on the values set for the DataSource property. When the datasource property is set to NULL (default value is NULL), the component defaults to History Data List mode. It is to be remembered that the properties CategoryName, AutoAddItem, and AutoSerialize have to be set appropriately for the History Data List mode to work properly.
16+
## DataSource for AutoComplete
17+
Datasource for AutoComplete operates in one of two ways, chosen by the DataSource property:
18+
- History Data List mode: When DataSource is null (default), the control records and uses user-entered items. Set CategoryName, AutoAddItem, and AutoSerialize appropriately for this mode.
19+
- Data source mode: When DataSource is set, items come from your bound list.
1920

2021
## Override Combo
21-
If MS ComboBox is used as editor control, the Combobox dropdown can be suppressed and overridden by the AutoComplete component using the OverrideCombo property.
22+
When using a standard Windows Forms ComboBox as the editor, you can suppress the ComboBox’s own drop-down and use AutoComplete’s suggestion UI via the OverrideCombo property.
2223

2324
![AutoComplete OverrideCombo](AutoComplete-Images/autocomplete_overridecombo.png)
2425

2526
## Persistence
26-
The history list of AutoComplete component can be saved in the following formats:
27-
28-
* Binary Format
29-
* XML Format
30-
* IsolatedStorage medium
31-
* MemoryStream
32-
* PersistState property
27+
The AutoComplete history list can be persisted in the following formats:
3328

34-
The AutoComplete component has a fully built-in serialization feature that provides automatic serialization for the AutoComplete’s history list. The serialization mechanism is implemented using the standardized Syncfusion.Windows.Forms.AppStateSerializer component that acts as a central coordinator for all the Essential tools components and provides options to read or write to different media such as the default isolated storage, XML file, XML stream, binary file, binary stream, and the Windows Registry.
35-
36-
# Integration with RichTextBox control
29+
- Binary file/stream
30+
- XML file/stream
31+
- Isolated storage
32+
- Windows Registry
3733

38-
The auto-complete functionality can be added to the RichTextBox control. The following steps are used to integrate the RichTextBox with the AutoComplete component:
34+
You control this via the PersistState property and AppStateSerializer settings. Note: The serializer type is Syncfusion.Windows.Forms.AppStateSerializer.
3935

40-
1. Implement the `IEditControlsEmbed` interface in a CustomRichTextBox class that enables the AutoComplete functionality for the RichTextBox control.
36+
## Integration with RichTextBox control
37+
You can enable AutoComplete on a RichTextBox by implementing IEditControlsEmbed and calling SetAutoComplete.
4138

42-
## C#
39+
Step 1: Implement `IEditControlsEmbed`
40+
```C#
41+
using System.Windows.Forms;
42+
using Syncfusion.Windows.Forms.Tools;
4343

44-
public class CustomRichTextBox : System.Windows.Forms.RichTextBox, IEditControlsEmbed
45-
46-
{
44+
public class CustomRichTextBox : RichTextBox, IEditControlsEmbed
45+
{
4746
// Returns the active RichTextBox control.
4847
public Control GetActiveEditControl(IEditControlsEmbedListener listener)
4948
{
5049
return (Control)this;
5150
}
5251
}
53-
54-
2. Create an instance for the CustomRichTextBox class and the AutoComplete component. Then, use the [SetAutoComplete](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.AutoComplete.html#Syncfusion_Windows_Forms_Tools_AutoComplete_SetAutoComplete_System_Windows_Forms_Control_Syncfusion_Windows_Forms_Tools_AutoCompleteModes_) method of AutoComplete component to enable auto-complete support for the RichTextBox control.
55-
56-
## C#
57-
58-
Syncfusion.Windows.Forms.Tools.AutoComplete autoComplete1= new Syncfusion.Windows.Forms.Tools.AutoComplete();
59-
CustomRichTextBox richTextBox1= new CustomRichTextBox();
60-
autoComplete1.SetAutoComplete(richTextBox1, Syncfusion.Windows.Forms.Tools.AutoCompleteModes.AutoSuggest);
61-
52+
```
53+
Step 2: Attach AutoComplete
54+
```C#
55+
var autoComplete = new AutoComplete();
56+
var richTextBox = new CustomRichTextBox();
57+
autoComplete.SetAutoComplete(richTextBox, AutoCompleteModes.AutoSuggest);
58+
```
6259
![RichTextBox Integration](AutoComplete-Images/autocomplete_richtextbox.png)

0 commit comments

Comments
 (0)