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; } } }
private void add_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { using (EditDirForm dlg = new EditDirForm("")) { if (dlg.ShowDialog() == DialogResult.OK) { listBox1.Items.Add(dlg.Dir); modified = true; ok.Enabled = apply.Enabled = modified; listBox1.SelectedIndex = listBox1.Items.Count - 1; } } }