private void listView1_DoubleClick(object sender, EventArgs e) { ListView.SelectedListViewItemCollection items = listView1.SelectedItems; if (items.Count > 0) { InsertTask dlg = new InsertTask(sm, (int)items[0].Tag); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { LoadTasks(); } } }
private void изменитьToolStripMenuItem_Click(object sender, EventArgs e) { ListView.SelectedListViewItemCollection items = listView1.SelectedItems; bool UpdateAfterEdit = false; foreach (ListViewItem item in items) { InsertTask dlg = new InsertTask(sm, (int)item.Tag); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { UpdateAfterEdit = true; } } if (UpdateAfterEdit) LoadTasks(); }
private void button1_Click(object sender, EventArgs e) { InsertTask dlg = new InsertTask(sm); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { LoadTasks(); } }