DateTime dd1 = Convert.ToDateTime(textBox1.Text);
DateTime dd2 = Convert.ToDateTime(textBox2.Text); if (dd1.CompareTo(dd2)
== 1)
{ //Textbox1 Date Is Greater Than
Textbox2 Date... MessageBox.Show(dd1.Date.ToShortDateString()
+ " Is Greater Than " + dd2.Date.ToShortDateString());
} elseif (dd1.CompareTo(dd2) == -1)
{ //Textbox2 Date Is Greater Than
Textbox1 Date... MessageBox.Show(dd2.Date.ToShortDateString()
+ " Is Greater Than " + dd1.Date.ToShortDateString());
} else
{ MessageBox.Show("Both Dates
Are Equal.");
}
0 comments
Comments
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
Join the conversation! Your thoughts help the community grow.