Showing posts with label palindrome in vb.net. Show all posts
Showing posts with label palindrome in vb.net. Show all posts

Sunday, March 5, 2017

Palindrome Checker in Visual Basic NET

Here is another simple program that I wrote using Visual Basic NET to ask the user to give a string and then our program will check and determine if the given string is a Palindrome or Not a Palindrome. The code is very simple and easy to understand. I hope you will learn from this one. Thank  you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing


Public Class Form1

    Public Function StrPalindrome(ByVal sSource As String) As String
        Dim s1 As String
        Dim s2 As String
        s1 = TextBox1.Text
        s2 = StrReverse(s1)
        If (s1 = s2) Then
            MessageBox.Show("The give word " & UCase(TextBox1.Text) & " is a Palindrome.")
        Else
            MessageBox.Show("The give word " & UCase(TextBox1.Text) & " is Not a Palindrome.")
        End If
    End Function


    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        End
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim str_word As String

        str_word = StrPalindrome(TextBox1.Text)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox1.Focus()
    End Sub
End Class



Sunday, April 24, 2016

Palindrome in Visual Basic.NET

A program that I wrote in Visual Basic.NET that will check if the given word by the user is a palindrome or not a palindrome.

 Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.





Sample Program Output


Program Listing

Public Class Form1

    Private Sub Find_Palindrome(ByVal strString As String)
        Dim str As String
        str = StrReverse(UCase(strString))
        If str.Equals(UCase(strString)) Then
            Label2.Text = UCase(strString) + " is a Palindrome."
        Else
            Label2.Text = UCase(strString) + " is Not a Palindrome."
        End If
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Label2.Visible = True
        Find_Palindrome(TextBox1.Text)
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label2.Visible = False
        TextBox1.Focus()
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Label2.Visible = False
        Label2.Text = ""
        TextBox1.Text = ""
        TextBox1.Focus()
    End Sub
End Class