in VB

Code:
If ((Text1.Text Mod 2) = 0) Then
        MsgBox "Even"
    Else
        MsgBox "Odd"
    End If

.