How to implement AutoComplete control in a User control?

4 Oct 20181 minute to read

AutoComplete control can be used in a User control by setting the parent form of the User Control to the parent form property of the AutoComplete control.

  • C#
  • private void UserControl1_Load(object sender, System.EventArgs e) 
    this.autoComplete1.ParentForm = this.ParentForm;  
    this.autoComplete1.DataSource = this.items; 
  • Private Sub UserControl1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Me.autoComplete1.ParentForm = Me.ParentForm
        Me.autoComplete1.DataSource = Me.items
    End Sub