0
Private Sub Command4_Click()
  Dim x As Integer
  r = InputBox("Enter row size ")
  c = InputBox("Enter column size ")
  ReDim arr(r, c) As Integer
  For i = 0 To r - 1 Step 1
    For j = 0 To c - 1 Step 1
     arr(i, j) = InputBox("Enter row : " & (i + 1) & "column size : " & (j + 1))
    Next j
  Next i
  For i = 0 To r - 1
    For j = 0 To c - 1
      Text1.Text = Text1.Text & " " & arr(i, j)
  Next j
    Text1.Text = Text1.Text & vbNewLine & vbCr
 Next i
End Sub

这是我在数组中输入的代码。除了这一行“Text1.Text = Text1.Text & vbNewLine & vbCr”之外,这里一切正常不工作,我的数组打印在一行中。

4

1 回答 1

1

我建议vbCrLf代替vbNewLine & vbCr,并且您需要确保在属性编辑器中将文本框设置为 Multiline 。

于 2012-04-19T13:15:24.720 回答