首页上一页 1 下一页尾页 3 条记录 1/1页
关于控件参考大全8.1.4\01代码的为问题
发表在VB答疑区
2010-05-02
是否精华
是
否
版块置顶:
是
否
在以下的代码中有很多没有经过声明,所以有点看不懂
Dim start, finish, money As Integer
Private Sub Command1_Click()
For i = 0 To 3
If Option1(i).Value = True Then
Exit For
Else
If i = 3 Then Exit Sub
End If
Next i
money = money - 20: Label2.Caption = money: Command1.Enabled = False
Do
[font color=#FF0000]no [/font]= Int(Rnd * 4)
wit = Int(Rnd * 21) + 23
Image1(no).Move Image1(no).Left + wit, Image1(no).Top
pause (0.03)
Loop Until Image1(no).Left + Image1(no).Width > finish
If Option1(no).Value = True Then
MsgBox Option1(no).Caption + "赢了!"
money = money + 60: Label2.Caption = money
Else
MsgBox "你输了!"
End If
If money = 0 Then
MsgBox "你已经没赌注了!"
Else
Command1.Enabled = True
End If
For i = 0 To 3
Option1(i).Value = False: Image1(i).Left = start
Next i
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Randomize Timer ‘这里没看见计时器
start = Image1(0).Left
finish = 6000
money = 100
Label2.Caption = money
End Sub
Sub pause(x) ’这里的过程设计思路是什么
w = Timer
Do While Timer - w <= m
wait = DoEvents ‘这里是指什么
Loop
End Sub
能否请编辑老师给予详细的解答
Dim start, finish, money As Integer
Private Sub Command1_Click()
For i = 0 To 3
If Option1(i).Value = True Then
Exit For
Else
If i = 3 Then Exit Sub
End If
Next i
money = money - 20: Label2.Caption = money: Command1.Enabled = False
Do
[font color=#FF0000]no [/font]= Int(Rnd * 4)
wit = Int(Rnd * 21) + 23
Image1(no).Move Image1(no).Left + wit, Image1(no).Top
pause (0.03)
Loop Until Image1(no).Left + Image1(no).Width > finish
If Option1(no).Value = True Then
MsgBox Option1(no).Caption + "赢了!"
money = money + 60: Label2.Caption = money
Else
MsgBox "你输了!"
End If
If money = 0 Then
MsgBox "你已经没赌注了!"
Else
Command1.Enabled = True
End If
For i = 0 To 3
Option1(i).Value = False: Image1(i).Left = start
Next i
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Randomize Timer ‘这里没看见计时器
start = Image1(0).Left
finish = 6000
money = 100
Label2.Caption = money
End Sub
Sub pause(x) ’这里的过程设计思路是什么
w = Timer
Do While Timer - w <= m
wait = DoEvents ‘这里是指什么
Loop
End Sub
能否请编辑老师给予详细的解答