private void btnEdit_Click(object sender, EventArgs e) { IncludedPath includedPath = lbIncludedPath.SelectedItem as IncludedPath; IncludedPathForm dlg = new IncludedPathForm(); dlg.StartPosition = FormStartPosition.CenterParent; dlg.SetIncludedPath(includedPath); DialogResult dr = dlg.ShowDialog(this); if (dr == DialogResult.OK) { lbIncludedPath.Items[lbIncludedPath.SelectedIndex] = dlg.IncludedPath; } }
private void btnAddIncludePath_Click(object sender, EventArgs e) { IncludedPathForm dlg = new IncludedPathForm(); dlg.StartPosition = FormStartPosition.CenterParent; DialogResult dr = dlg.ShowDialog(this); if (dr == DialogResult.OK) { lbIncludedPath.Items.Add(dlg.IncludedPath); } }