<送分题>,能者多得
我定义了几个textbox的数组
Text1(0),Text1(1),Text1(2),Text1(3).....
还有一个Timer控件Timer1
我本来意思是想鼠标在哪个Text1里,就动态的更改随机数.
比如,鼠标单击Text(1)上就,使得Text1(1)里面内容变
现在的情况是,我放在Text1(1)里,每个都会变.不知道有没有什么办法,可以判断鼠标点击的热点
程序如下:
'鼠标按下1
Private Sub Text1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Timer1.Enabled = True
End If
End Sub
'鼠标释放1
Private Sub Text1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Timer1.Enabled = False
End If
End Sub
'时间事件1
Private Sub Timer1_Timer()
Dim i As Integer
On Error Resume Next
'第一注
For i = 0 To 3
Randomize
Text1(i).Text = Format(Int(Rnd * (9 - 0 + 1)), "0")
Next i
End Sub