#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Smile Help with palindrome code


    Private Sub btnTest_Click(sender As System.Object, e As System.EventArgs) Handles btnTest.Click
    Dim Foreward As String = txtInput.Text
    Dim Backward As String
    Backward = StrReverse(Foreward)
    txtInput.Text = Backward
    If Backward = Foreward Then
    MsgBox("TRUE, you have a palindrome")
    Else
    MsgBox("FALSE, you do not have a palindrome")
    End If
    End Sub

    Instead of message boxes I have two text boxes one where the user inputs a word or words and then they click a button to test if it's a palindrome or not. So how would I code it to post the "you/you do not have a palindrome in the second textbox?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    3
    Rep Power
    0
    Are you asking how to enter those messages into a textbox rather than by using message boxes? Because if you are, you can change the text property of the textbox using

    textbox2.text = "You/you do not have a palindrome"

    in place of the messageboxes.
    You can change the property of any control using the name of the control, followed by .(property) = ...

IMN logo majestic logo threadwatch logo seochat tools logo