private void lstvTable_DoubleClick(object sender, EventArgs e) { int selectIndex = lstvTable.SelectedIndices[0]; int itemIndex = (int)lstvTable.SelectedItems[0].Tag; FLUTItem frm = new FLUTItem(this, itemIndex); frm.Text = "Edit Translation Item"; frm.ShowDialog(this); lstvTable.Items[selectIndex].Selected = true; }
private void btnAdd_Click(object sender, EventArgs e) { int count = LUItemList.Count; FLUTItem frm = new FLUTItem(this); frm.Text = "Add Translation Item"; frm.ShowDialog(this); this.lblNo.Text = LUItemList.Count + " item(s)"; if (LUItemList.Count > count) { int i = 0; foreach (ListViewItem viewItem in lstvTable.Items) { if ((int)viewItem.Tag == count) { lstvTable.Items[i].Selected = true; break; } i++; } } }