Private Function getstring(inputbox As Integer) As String Select Case inputbox Case 1 getstring = "哈哈" Case 2 getstring = "呵呵" Case Else End Select End Function
Private Sub Cmd1_Click() Label1.Caption = getstring(inputbox as Integer) as String Label1.Caption = "case 2"
End Sub
不行啊,它说有问题
Private Sub Command1_Click()
Static i As Integer
Dim s As String
Select Case i
Case 0 s = "你好!" Case 1 s = "告诉你一句悄悄话," Case 2 s = "你听了不要激动哦,"
Case 3 s = "....."
Case 4 s = "知道了吗?"
'case ...可以添加其他语句
Case Else
s = ""
End Select
Label1.Caption = s
i = i + 1
End Sub