Here are the steps to use textbox with suggestion text input by user.
- Drag and Drop the Textbox from Tools panel into GUI Form.
- Design and Change the properties of the Textbox control like Name and Text Properties.
- Right Click the form and Chose View Code.
- Add the Form Load Events.
- Add the following code statement inside the form load events.
- Run the Project and the out may like this.
- Dim Col As New Collection
- With Col
- .Add("Philippines")
- .Add("Singapore")
- .Add("Malaysia")
- .Add("Vietname")
- .Add("Korea")
- End With
- txtCountry.AutoCompleteMode = AutoCompleteMode.Suggest
- txtCountry.AutoCompleteSource = AutoCompleteSource.CustomSource
- For Each item In Col
- txtCountry.AutoCompleteCustomSource.Add(item)
- Next
Download the Project Here.
No comments:
Post a Comment