public AddUpdateTaskForm(User _user, bool _isUpdate, dateForm dateForm, tasksForm tasksForm) { InitializeComponent(); user = _user; isUpdate = _isUpdate; comboPriority.SelectedIndex = 0; this.dateForm = dateForm; this.tasksForm = tasksForm; instance = this; deadlineDateTimePicker.Format = DateTimePickerFormat.Custom; deadlineDateTimePicker.CustomFormat = "MM/dd/yyyy hh:mm tt"; }
private void addUpdateTaskToolStripMenuItem_Click(object sender, EventArgs e) { if (task == null) { task = new tasksForm(theUser); //task.MdiParent = this; task.StartPosition = FormStartPosition.CenterScreen; task.FormClosed += Task_FormClosed; task.ShowDialog(); } else { task.Activate(); } }
private void Task_FormClosed(object sender, FormClosedEventArgs e) { task.Dispose(); task = null; }
public tasksForm(User _user) { InitializeComponent(); user = _user; instance = this; }