vb.net菜鸟问题,希望高手不吝赐教
Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
Dim a, b, c, d As Integer
Dim i(2) As String
Dim f As Single
For d = 0 To 2
i(d) = Int(Rnd() * 10)
a = i(0) : b = i(1) : c = i(2)
For f = 1 To 10000 Step 0.001
Next f
txt1.Text = a & b & c
txt1.Refresh()
Next d
End Sub
我想问的是程序加入 For f = 1 To 10000 Step 0.001 后为什么 txt1文本框内的3个随机数字是有时间间隔产生的,For f = 1 To 10000 Step 0.001 怎么解释,帮我理解下这句代码吧,谢谢各位了!!
[解决办法]
For f = 1 To 10000 Step 0.001 是个空循环,延时一下而已,不过系统有延时的方法,不应该用这个
System.Threading.Thread.Sleep(1000)
[解决办法]