VB中msgbox如何显示多个变量

比如要显示abcde五个变量的值,应该怎么表达这个语句
2024-11-16 05:36:13
推荐回答(5个)
回答(1):

MsgBox "登陆成功," & text1.text & "欢迎您!", 48, "欢迎进入"
不用引号引起变量``用& 连接字符

回答(2):

先定义a
Dim a As String
Private Sub Command1_Click()
......
End Sub

Private Sub Form_Click()
a = Int(Rnd * (999 - 100 + 1) + 100)
......
End Sub

回答(3):

msgbox a & b & c & d & e

回答(4):

msgbox "a:" & a & vbcrlf _
"b:" & b & vbcrlf _
"c:" & c & vbcrlf _
"d:" & d & vbcrlf _
"e:" & e

回答(5):

msgbox a & b & c & d & e & f