Hi, I recently made an age calculator using C# Win form application. So I set this "If" code for the application saying that if the Date of Birth is set greater than the Current date, an error message should pop up.
Code:
'if (dtpcurrentdate.Value < dtpdateofbirth.Value) ;
{
MessageBox.Show("Current date must be greater than Date of Birth. Please Try Again");
}'
When I run the application, test it and set the Date of Birth greater than the Current date, the error message is popping. But when I set Date of Birth lesser than the current date, the error message still pops up. My aim is that the error should not occur when users set the Date of Birth lesser than the current date and should only pop up if they set it greater than the current date. Please help!