I am working on a program for fun, that when you enter a person's age the program can tell if it is within this century. Simply put, a person enters an age and the computer subtracts the current year from the age to see if the age is positive. I've run into a weird problem though. Most of the time, the program sees the given age as being greater than 2008. A sample is listed below:
Dim age As String = TextBox1.Text
Dim year As String = Date.Now.Year
If age > year Then
MsgBox("Greater than")
End If
It doesn't always show the msgbox, but try entering in 23 and it will but enter 20 and it does not. Thanks for any help!
Dim age As String = TextBox1.Text
Dim year As String = Date.Now.Year
If age > year Then
MsgBox("Greater than")
End If
It doesn't always show the msgbox, but try entering in 23 and it will but enter 20 and it does not. Thanks for any help!