第一个IF语句确实运行良好,其他IF语句不起作用。当我点击按钮什么都没有发生。第一个IF语句运行良好,而下一个IF语句不再有效
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text.Trim = "What is your name?" Then
Label1.Text = "Hi there kid! I will tell you later!"
Return
If TextBox1.Text.Trim = "What is your age?" Then
Label1.Text = "I was made in January 31,2014 well that is my birth date!"
Return
If TextBox1.Text = "Hi" Then
Label1.Text = "Hi there also!"
Else
Label1.Text = "Do you have anything you want to say other than that?"
End If
End If
End If
End Sub
使用“返回”退出了事件处理程序 – Jesse
@Jesse当我删除返回它仍然行为相同..:*( – TheNewbie
你IFS也嵌套,它TextBox1.Text是不可能的.Trim等于“你的年龄?”,如果它已经等于“你的名字是什么?” – Jesse