Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<String> fullFileName;
- List<String> fullFileName2;
- List<string> selectedScripts = new List<string>();
- public void listBox3_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (listBox3.SelectedIndex >= 0)
- {
- string fullFileName2 = selectedScripts[listBox3.SelectedIndex];
- textBox3.Text = fullFileName2;
- string File1 = fullFileName2;
- string text = System.IO.File.ReadAllText(File1);
- textEditorControl1.Text = text;
- textEditorControl1.Refresh();
- }
- else
- {
- }
- private void materialFlatButton10_Click(object sender, EventArgs e)
- {
- OpenFileDialog OpenFileDialog1 = new OpenFileDialog();
- OpenFileDialog1.Multiselect = true;
- OpenFileDialog1.Filter = "Text Files|*.txt|All Files|*.*|Lua Files|*.lua";
- OpenFileDialog1.Title = "Select a Text/Lua File";
- if (OpenFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- fullFileName2 = new List<String>(OpenFileDialog1.FileNames);
- foreach (string s in OpenFileDialog1.FileNames)
- {
- listBox3.Items.Add(Path.GetFileName(s));
- selectedScripts.Add(s);
- }
- }
- }
- private void deleteFromListToolStripMenuItem_Click(object sender, EventArgs e)
- {
- label4.Text = " ";
- textBox3.Text = "";
- IDocument document = textEditorControl1.Document;
- document.Remove(0, document.TextLength);
- textEditorControl1.Refresh();
- selectedScripts.Clear();
- for (int i = listBox3.SelectedIndices.Count - 1; i >= 0; i--)
- {
- listBox3.Items.RemoveAt(listBox3.SelectedIndices[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement