为什么chr(13)+chr(10),在Text里面不换行显示?
OptionExplicitDima(9)AsLongPrivateSubCmd1_Click()DimiAsLong,lAsLongText1.Text=""Fori=...
Option Explicit
Dim a(9) As Long
Private Sub Cmd1_Click()
Dim i As Long, l As Long
Text1.Text = ""
For i = 0 To 9
N:
l = InputBox("请输入排序的10个数,这是第" & CStr(i + 1) & "数")
If IsNumeric(l) Then
a(i) = l
Else
MsgBox "请输入数字", vbOKOnly, "错误"
GoTo N
End If
Next i
End Sub
Private Sub Cmd2_Click()
Dim i As Long, j As Long, b As Long
For i = 1 To 9
For j = 0 To 9 - 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 = 0 To 9
Text1.Text = Text1.Text + CStr(a(i)) + " "
If i = 4 Then
Text1.Text = Text1.Text + Chr(13) + Chr(10)
End If
Next i
End Sub 展开
Dim a(9) As Long
Private Sub Cmd1_Click()
Dim i As Long, l As Long
Text1.Text = ""
For i = 0 To 9
N:
l = InputBox("请输入排序的10个数,这是第" & CStr(i + 1) & "数")
If IsNumeric(l) Then
a(i) = l
Else
MsgBox "请输入数字", vbOKOnly, "错误"
GoTo N
End If
Next i
End Sub
Private Sub Cmd2_Click()
Dim i As Long, j As Long, b As Long
For i = 1 To 9
For j = 0 To 9 - 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 = 0 To 9
Text1.Text = Text1.Text + CStr(a(i)) + " "
If i = 4 Then
Text1.Text = Text1.Text + Chr(13) + Chr(10)
End If
Next i
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询