在 vb 程序设计中设计一个程序,窗体中有2个文本框,2个命令按钮。
1个回答
展开全部
Option ExplicitDim s(9) As Long
Private Sub Command1_Click()
Dim i As Long
For i = 1 To 9
PaiXu i
Next
Text2.Text = ""
For i = 0 To 9
Text2.Text = Text2.Text & s(i) & ","
Next
End Sub
Private Sub Form_Load()
Dim i As Long
Text1 = ""
Text2.Text = ""
Randomize
For i = 0 To 9
s(i) = Fix(Rnd() * 90 + 10)
Text1.Text = Text1.Text & s(i) & ","
Next
End Sub
Public Sub MaxS(a As Long, b As Long)
Dim c As Long
If b < a Then
c = a
a = b
b = c
End If
End Sub
Public Sub PaiXu(n As Long)
Dim i As Long
DoEvents
If n < 0 Or n > 8 Then Exit Sub
MaxS s(n), s(n + 1)
PaiXu n - 1
End Sub
Private Sub Command1_Click()
Dim i As Long
For i = 1 To 9
PaiXu i
Next
Text2.Text = ""
For i = 0 To 9
Text2.Text = Text2.Text & s(i) & ","
Next
End Sub
Private Sub Form_Load()
Dim i As Long
Text1 = ""
Text2.Text = ""
Randomize
For i = 0 To 9
s(i) = Fix(Rnd() * 90 + 10)
Text1.Text = Text1.Text & s(i) & ","
Next
End Sub
Public Sub MaxS(a As Long, b As Long)
Dim c As Long
If b < a Then
c = a
a = b
b = c
End If
End Sub
Public Sub PaiXu(n As Long)
Dim i As Long
DoEvents
If n < 0 Or n > 8 Then Exit Sub
MaxS s(n), s(n + 1)
PaiXu n - 1
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询