How do I read the text of a resource txt file and put it into a TextBox in C# .net 4.0 WPF?
I have a TextBox in my form and a TXT file in my resources folder,
how do I put the text from the TXT file (including the line breaks, double spaces, etc) into the TextBox?
Please simplify the code for me because I’m a beginner in C#…
Thanks!
No difference reading file in WinForms or in WPF.
Simply add to you window TextBox and load file via System.IO.File class.
Example :
and code behavior :