标题:为什么到第五个数字没有换行?
取消只看楼主
ehszt
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:40
帖 子:1728
专家分:3216
注 册:2015-12-2
结帖率:100%
已结贴  问题点数:20 回复次数:0 
为什么到第五个数字没有换行?
Dim a(10) As Long
Private Sub Command1_Click()
Dim i As Long, b As Long, j As Long
For i = 1 To 10
    For j = 1 To 10 - i
      If a(j) > a(j + 1) Then
      b = a(j)
      a(j) = a(j + 1)
      a(j + 1) = b
      End If
    Next j
Next i
For i = 1 To 10
    Text1.Text = Text1.Text + CStr(a(i)) + "  "
    If i = 5 Then Text1.Text = Text1.Text + Chr(13) + Chr(10)
Next i
End Sub
Private Sub command2_click()
Dim i As Long, l
Text1.Text = ""
For i = 1 To 10
N:    l = InputBox("请输入10个数,这是第" & CStr(i) & "个", "提示", "")
    If IsNumeric(l) Then
    a(i) = l
    Else
       MsgBox "请输入数字", vbOKOnly, "错误"
       GoTo N
    End If
Next i
End Sub
2016-08-03 16:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-467496-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.390695 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved