private void button_loadScript_Click(object sender, EventArgs e) { string scriptName = textBox_script.Text; try { pm.loadScript(scriptName); using (StreamReader reader = File.OpenText(scriptName)) { string line; while ((line = reader.ReadLine()) != null) { listView1.Items.Add(new ListViewItem(line)); } } // TODO should this be here? button_run.Enabled = true; button_step.Enabled = true; label_loadedScript.Text = "Script Loaded: \"" + scriptName + "\""; } catch (FileNotFoundException) { MessageBox.Show("File doesn't exist"); } }