private void toolStripMainItem_fileEdit_Click(object sender, EventArgs e) { if (listBox_main.SelectedItems.Count == 1) { FormEditEntry f = new FormEditEntry(); f.currentFileLocation = currentFileLocation; f.stringToEdit = listBox_main.SelectedItem.ToString(); f.selectedListIndex = listBox_main.SelectedIndex; f.Show(); } }