Create an AutoCompleteStringCollection
Use the Add method of your newly created list to populate it.
Set your textbox's AutoCompleteCustomSource to your list
set your textbox's AutocompleteMode to your preference (ie, Suggest, SuggestAppend, ect)
Set your textbox's AutoCompleteSource to AutoCompleteSource.CustomSource
What i want is not the auto complete option but instead the textbox is empty and even though i don't type anything; when i click inside it, it shows me the list of values.
I would have chosen the combo box, but i want to do something new this time
The ComboBox control is designed for one purpose and the TextBox for another. If what you want to achieve matches the purpose the ComboBox was designed fro then you should use a ComboBox. If you want something in programming to challenge you then there are far more useful things you could be doing than trying to use a TextBox where a ComboBox is more appropriate.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.