private void toolStripMenuItem1_Click(object sender, EventArgs e) { //String inputMessage = System.Windows.Forms.InputDialogBox.Show("Enter Text:"); AddToDoForm testDialog = new AddToDoForm(); // Show testDialog as a modal dialog and determine if DialogResult = OK. if (testDialog.ShowDialog(this) == DialogResult.OK) { // Read the contents of testDialog's TextBox. // MessageBox.Show(); Dictionary<String, String> data = new Dictionary<String, String>(); data.Add("task", testDialog.ToDoText); data.Add("dueto", testDialog.ToDoDate.ToShortDateString()); try { db.Insert("todo", data); } catch (Exception crap) { MessageBox.Show(crap.Message); } } else { // MessageBox.Show("Cancelled"); } testDialog.Dispose(); }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { AddToDoForm testDialog = new AddToDoForm(); if (testDialog.ShowDialog(this) == DialogResult.OK) { todo.AddTodo(testDialog.ToDoText, testDialog.ToDoDate, testDialog.ToDoPriority); todo.LoadTodo(); } else { // MessageBox.Show("Cancelled"); } testDialog.Dispose(); ToDoButton.Hide(); ToDoButton.Text = todo.LoadTodo(); ToDoButton.Left = (this.Width - ToDoButton.Width) / 2; ToDoButton.Top = (this.Height - ToDoButton.Height) / 2; ToDoButton.Show(); }