急............. VB随机数的问题 急.......... 如何让单击一个按钮,然后按钮上出现一个3位数

来源:百度知道 编辑:UC知道 时间:2024/06/07 14:51:41
比如:111、121、123、321、223、132、332、312、231等等...
3位数是由1.2.3这3个数组成的

Private Sub Command1_Click()
Dim intN As Integer
For intN = 1 To 10
Randomize
'Print CInt(Rnd * (999 - 100 + 1) + 100)
Print CInt(Rnd * 2 + 1) & CInt(Rnd * 2 + 1) & CInt(Rnd * 2 + 1)

Next
End Sub

运行无误。希望对你有所帮助

####################################################################3
我的程序作了修改
#############################################3

int(random(10)*100)

private sub form1_load()
randmize
end sub
private sub command1_click()
command1.caption=cstr(int(rnd*900+100))
end sub