Dim a(4, 4) As Object
Dim i, j As Integer
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i = 0 To 4
For j = 0 To 4
If j = 0 Then
a(i, j) = "姓名:" & InputBox("请输入姓名", "还有" & 5 - i & "个")
ElseIf j = 1 Then
a(i, j) = "年龄:" & InputBox("请输入年龄", "还有" & 5 - i & "个")
ElseIf j = 2 Then
a(i, j) = "通信地址:" & InputBox("请输入通信地址", "还有" & 5 - i & "个")
ElseIf j = 3 Then
a(i, j) = "邮政编码:" & InputBox("请输入邮政编码", "还有" & 5 - i & "个")
ElseIf j = 4 Then
a(i, j) = "电话:" & InputBox("请输入电话", "还有" & 5 - i & "个")
End If
Next
Next
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mystr As String = ""
For i = 0 To 4
For j = 0 To 4
mystr = mystr & a(i, j) & Space(3)
Next
mystr = mystr & vbCrLf
Next
MsgBox(mystr, , "个人资料")
End Sub