2

I am trying to make an autocomplete textbox in c# so I set the AutoCompleteMode to SuggestAppend and set the AutoCompleteSource to custom,

It now works fine every time I start the exe but the problem is that it forgets the history when I close the exe and open it again.....so how can I make its history permanent?

Joseph Quinsey
  • 9,553
  • 10
  • 54
  • 77
Ahmad Houri
  • 1,117
  • 4
  • 16
  • 26

3 Answers3

1

You can save suggestions/history in text file and also update text file on each search refer this link

Nik
  • 86
  • 4
0

You could use your own AutoCompleteCustomSource .

Catch the TextChanged event, save the new text to a file.

Your AutoCompleteCustomSource should read its values from that file.

You can read more on how to use AutoCompleteCustomSource here:

ListBox items as AutoCompleteCustomSource for a textbox

Community
  • 1
  • 1
omer schleifer
  • 3,897
  • 5
  • 31
  • 42
0

you have to use all the three properties "AutoCompleteCustomSource", "AutoCompleteMode" and "AutoCompletesource" on TextBox class. then u will get the desired solution.

Anuj
  • 1,496
  • 1
  • 18
  • 28