private void btnAddTodo_Click(object sender, EventArgs e) { AddToDoForm form = new AddToDoForm(); form.Owner = this; var result =form.ShowDialog(); if (result == DialogResult.OK) { RefreshToDoList(); } }
/// <summary> /// 双击【待办】打开详情 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void todoList_MouseDoubleClick(object sender, MouseEventArgs e) { var selectIndex = todoList.SelectedIndex; if (selectIndex >= 0) { var deadline = DateTime.Parse(toDoDataList[selectIndex].Split(new char[] { '₪' })[1].TrimStart('(').TrimEnd(')')); var model = TodoDao.Get(deadline); AddToDoForm form = new AddToDoForm(model); form.ShowDialog(); } }