Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //The Code For The List Box
- => fastColoredTextBox1.Text = File.ReadAllText($"./Scripts/{listBox1.SelectedItem}");
- Refresh Code :
- listBox1.Items.Clear();//Clear Items in the LuaScriptList
- Functions.PopulateListBox(listBox1, "./Scripts", "*.txt");
- Functions.PopulateListBox(listBox1, "./Scripts", "*.lua");
- //Code to put into Functions
- public static void PopulateListBox(ListBox lsb, string Folder, string FileType)
- {
- DirectoryInfo dinfo = new DirectoryInfo(Folder);
- FileInfo[] Files = dinfo.GetFiles(FileType);
- foreach (FileInfo file in Files)
- {
- lsb.Items.Add(file.Name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement