private void dateTimePicker4_ValueChanged(object sender, EventArgs e) { try { DateTime startDate = (DateTime)dateTimePicker4.Value; DateTime endDate = (DateTime)dateTimePicker1.Value; DateTime endDate1 = (DateTime)dateTimePicker2.Value; DateTime endDate2 = (DateTime)dateTimePicker3.Value; TimeSpan ts = endDate.Subtract(startDate); TimeSpan ts1 = endDate1.Subtract(startDate); TimeSpan ts2 = endDate2.Subtract(startDate); textBox1.Text = ts.Days.ToString(); textBox2.Text = ts1.Days.ToString(); textBox3.Text = ts2.Days.ToString(); } catch {
int datet; datet = int.Parse(textBox1.Text); if (datet <17) { MessageBox.Show("time is short); }
System.DateTime
System.DateTime.Subtract
System.TimeSpan
TextBox
NumericUpDown
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)