private void cmdAdd_Click(object sender, EventArgs e) { frmEditDataSource oEdit = new frmEditDataSource(); oEdit.oDS = new DataSource(); oEdit.Location = Cursor.Position; if (oEdit.ShowDialog() == DialogResult.OK) { ListViewItem oLvwEdit = DatasourceToLVI(oEdit.oDS); lvwDS.Items.Add(oLvwEdit); } }
private void EditListviewItem(ListViewItem oItem) { frmEditDataSource oEdit = new frmEditDataSource(); oEdit.oDS = (DataSource)oItem.Tag; oEdit.Location = Cursor.Position; if (oEdit.ShowDialog() == DialogResult.OK) { ListViewItem oLvwEdit = DatasourceToLVI(oEdit.oDS); lvwDS.Items.Remove(oItem); lvwDS.Items.Add(oLvwEdit); } }