private void cmdDnsAdd_Click(object sender, EventArgs e) { SettingsIp Dlg = new SettingsIp(); if (Dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ListViewItem item = new ListViewItem(); item.Text = Dlg.Ip; lstDnsServers.Items.Add(item); lstDnsServers.SelectedItems.Clear(); item.Selected = true; item.EnsureVisible(); EnableIde(); } }
private void cmdDnsEdit_Click(object sender, EventArgs e) { if (lstDnsServers.SelectedItems.Count == 1) { ListViewItem item = lstDnsServers.SelectedItems[0]; SettingsIp Dlg = new SettingsIp(); Dlg.Ip = item.Text; if (Dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { item.Text = Dlg.Ip; EnableIde(); } } }