Enabling Autocomplete in Textbox area in WinForms Editable ListBox
27 Apr 20211 minute to read
We can associate an AutoComplete with the editing TextBox of the EditableList. The following steps help to achieve this.
- Create an instance of the AutoComplete.
- In the Form load event, place this code.
private void form1_Load(object sender,EventArgs e)
{
// Sets the AutoComplete.
autoComplete1.DataSource=editableList1.ListBox.Items;
autoComplete1.SetAutoComplete(editableList1.TextBox,AutoCompleteModes.Both);
}
Private Sub form1_Load(ByVal sender As Object, ByVal e As EventArgs)
' Sets the AutoComplete.
autoComplete1.DataSource=editableList1.ListBox.Items
autoComplete1.SetAutoComplete(editableList1.TextBox,AutoCompleteModes.Both)
End Sub
The data source may vary according to your choice.