private void btnAddExtraDesc_Click(object sender, EventArgs e) { EditExtendedDescription dialog = new EditExtendedDescription(new ExtendedDescription()); if (dialog.ShowDialog() == DialogResult.OK) { lstExtraDesc.Items.Add(dialog.GetExtendedDescription()); } }
private void btnEditExtraDescr_Click(object sender, EventArgs e) { int index = lstExtraDesc.SelectedIndex; if (index != -1) { ExtendedDescription desc = lstExtraDesc.SelectedItem as ExtendedDescription; EditExtendedDescription dialog = new EditExtendedDescription(desc); if (dialog.ShowDialog() == DialogResult.OK) { lstExtraDesc.Items.RemoveAt(index); lstExtraDesc.Items.Insert(index, dialog.GetExtendedDescription()); } } }
private void btnEditExtraDescr_Click(object sender, EventArgs e) { int index = lstExtraDesc.SelectedIndex; if (index != -1) { ExtendedDescription desc = lstExtraDesc.SelectedItem as ExtendedDescription; EditExtendedDescription dialog = new EditExtendedDescription(desc); if (dialog.ShowDialog() == DialogResult.OK) { lstExtraDesc.Items.RemoveAt(index); lstExtraDesc.Items.Insert(index,dialog.GetExtendedDescription()); } } }