private void btnAddGlobalZone_Click(object sender, EventArgs e) { GlobalZonesInputBox gzib = new GlobalZonesInputBox(lvwGlobalZones.Items); if (gzib.ShowDialog(this) == DialogResult.Cancel) { return; } ListViewItem lvi = new ListViewItem(); lvi.Text = gzib.txtGlobalZoneName.Text; lvwGlobalZones.Items.Add(lvi); }
private void btnEditGlobalZone_Click(object sender, EventArgs e) { ListViewItem lvi = lvwGlobalZones.SelectedItems[0]; GlobalZonesInputBox gzib = new GlobalZonesInputBox(lvwGlobalZones.Items); gzib.Text = "Edit Global Zone"; gzib.txtGlobalZoneName.Text = lvi.SubItems[0].Text; if (gzib.ShowDialog(this) == DialogResult.Cancel) { return; } lvwGlobalZones.Items.Remove(lvi); ListViewItem lvi2 = new ListViewItem(); lvi2.Text = gzib.txtGlobalZoneName.Text; lvwGlobalZones.Items.Add(lvi2); }