❔ Load txt file
Hello there! im trying to make a simple Windows from application as a test. i currently have 3 forms, one main page, one textpage and one textload page. but i have gotten stuck. im trying to make a function where you press a button that says load on the textpage, that brings up the other form called textload that contains a listbox which shows all .txt files within a certain folder, however when you press load inside the text load i want it to load the content of the selected .txt file and load it into the richtextbox i have on the textpage. which is why i have come here to seek some help as i have not been able to find any solution online. i would also like to apologize for my bad writting.
8 Replies
File.ReadAllLines Method (System.IO)
Opens a text file, reads all lines of the file into a string array, and then closes the file.
Directory.EnumerateFiles Method (System.IO)
Returns an enumerable collection of full file names that meet specified criteria.
Directory.EnumerateDirectories Method (System.IO)
Returns an enumerable collection of directory full names that meet specified criteria.
Create a Windows Forms app with C# - Visual Studio (Windows)
Learn how to create a Windows Forms app in Visual Studio with C#, step-by-step.
this should lead you to the right direction
Once I’m home I will be able to look through this and provide some bits of my current code
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.