Tuesday, 27 March 2018

Use of if else statement to check the eligibility for voting

Public Class Form1
    Dim age As Single
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        age = TextBox1.Text
        If (age >= 18) Then
            Label3.Text = "Person is Eligible to Vote"
        Else
            Label3.Text = "Person is not eligible to vote"
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

No comments:

Post a Comment

Note: only a member of this blog may post a comment.