Kirk Charles Niverba Kirk Charles Niverba - 1 year ago 81 Question

Show last text on Textbox

Well, I've done a pretty messed up coding to do in VB [2013]

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

If TextBox1.Text <= 10 Then
TextBox1.Text += 2
ElseIf TextBox1.Text > 10 Then
TextBox1.Text = "Greater than 10!"
Button1.Enabled = False
End If

End Sub

Now all I need is to display the last message that have been on the Textbox. For example:

"Greater than 10!"

"Your last message is: 11"

Answer Source

If you want to display "Your last message is: 11" when "Greater than 10!" message will display, then you have to change your else statement

TextBox1.Text = "Greater than 10!"


TextBox1.Text = "Greater than 10!" & " Your last message is:" & TextBox1.Text