Please see my comment to the question. As you did not even specify what
TextBox
type you use, we don't even know what we are talking about.
But listen to my speculations. No matter what it is, it looks like you already know how to enable auto-complete; your question is only about the text file. Therefore, you should be able to read a text file into required data source, not matter what it is. The best you can use is the class
System.IO.StreamReader
with
using
statement:
http://msdn.microsoft.com/en-us/library/system.io.streamreader%28v=vs.110%29.aspx[
^],
http://msdn.microsoft.com/en-us/library/htd05whh.aspx[
^].
Alternatively, you can use
System.IO.File.ReadAllLines
(I think I can quite safely assume that your file is not too big) in one shot:
http://msdn.microsoft.com/en-us/library/system.io.file.readalllines%28v=vs.110%29.aspx[
^].
If your data source have to be just a bit more structured than that set of text lines, it is a fair reason to use XML (not, also a text file). Please see my recent answer:
XML Help please - Downloaded a file and I have no clue how to read it[
^].
What it the data source, how to populate its data — it's all on you, because you did not specify what you are using. If you still have further questions, please specify it and ask them.
—SA