private void edit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { using (EditDirForm dlg = new EditDirForm(listBox1.SelectedItem.ToString())) { if (dlg.ShowDialog() == DialogResult.OK) { listBox1.Items[listBox1.SelectedIndex] = dlg.Dir; modified = true; ok.Enabled = apply.Enabled = modified; } } }