都不是的话显示小仙女,帮忙看下哪里错了- -新手。。。
Private Sub Command1_Click()
Dim name As String
Dim resule As String
result = Val(Text1.Text)
If name = "小明" Then
Text1.Text = "男"
ElseIf name = "小红" Then
Text1.Text = "女"
test1.Text = "小仙女、"
End If
End Sub
都不是的话显示小仙女,帮忙看下哪里错了- -新手。。。
Private Sub Command1_Click()
Dim name As String
Dim resule As String
result = Val(Text1.Text)
If name = "小明" Then
Text1.Text = "男"
ElseIf name = "小红" Then
Text1.Text = "女"
test1.Text = "小仙女、"
End If
End Sub
程序完全不对,你的name没有输入,它从哪里来的?
后面判断也不对(少else)
且最后的test1也没有定义。
改好的参考下
Private Sub Command1_Click()
Dim name As String
name = Text1.Text
If name = "小明" Then
Text1.Text = "男"
ElseIf name = "小红" Then
Text1.Text = "女"
Else
Text1.Text = "小仙女、"
End If
End Sub