Program to check whether a character is vowel or not in VB.NET

In this program we are going to check whether a character is vowel or not and display the result in a Label(i.e label3)  on Button Click

Program UI:

Screenshot (15)

Program Code:

Public Class programmingfromscratch
Dim a As Char

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
a = UCase(TextBox1.Text)
If a = “A” Or a = “E” Or a = “I” Or a = “O” Or a = “U” Then
Label3.Text = “Vowel”
Else
Label3.Text = “Not Vowel”
End If
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Label3.Text = “”
TextBox1.Text = “”

End Sub

End Class

 

Output:

Screenshot (16).png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s