VB.NET中怎么实现每单击一次按钮,文本框就多出现一个1-13的随机数字? 15
1个回答
展开全部
Dim n As Integer, b As Integer, a(13) As Integer
Private Sub Command1_Click()
If b < 5 Then
b = b + 1
x = Int(n * Rnd()) + 1
Text1.Text = Text1.Text & a(x) & " "
a(x) = a(n)
n = n - 1
Else
Call Form_Load
End If
End Sub
Private Sub Form_Load()
Randomize
n = 13: b = 0
For i = 1 To 13
a(i) = i
Next i
Text1.Text = ""
End Sub
Private Sub Command1_Click()
If b < 5 Then
b = b + 1
x = Int(n * Rnd()) + 1
Text1.Text = Text1.Text & a(x) & " "
a(x) = a(n)
n = n - 1
Else
Call Form_Load
End If
End Sub
Private Sub Form_Load()
Randomize
n = 13: b = 0
For i = 1 To 13
a(i) = i
Next i
Text1.Text = ""
End Sub
追问
这感觉是vb的吧,没有vb.net的麽
追答
没学过VB.NET
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询