I have this program that you enter a year in the text box and it returns
either a true or false in the picture box based on if it is a leap year or
not. The program works fine but I need to return focus to the text box with
the old text selected. Any answers on how to do this. My code is below.
Thanks,
Kelsey
Private Sub Command1_Click()
If IsNumeric(txtInput.Text) Then
If IsLeapYear(txtInput.Text) Then
picOutput.Cls
picOutput.Print "True"
Else
picOutput.Cls
picOutput.Print "False"
End If
Else
MsgBox ("Enter in a Year")
picOutput.Cls
txtInput.Text = " "
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Here is the module--
Public Function IsLeapYear(Yr As Integer) As Boolean
IsLeapYear = False
If Yr Mod 4 = 0 Then
IsLeapYear = True
If Yr Mod 100 = 0 Then
If (Yr Mod 400) Then IsLeapYear = False
End If
End If
End Function