'Option Explicit
Private Sub Command1_Click()
Dim bet, wealth As Integer
Dim Num1, Num2, Num3 As Integer
Dim win As Boolean
Dim msg As String
Dim i
Dim StartTime As Single
'变量初始化
win = False
bet = Val(Text_bet.Text)
wealth = Val(Label_wealth.Caption)
'骰子滚动时的界面
Command1.Enabled = False
Label_info.Caption = "……"
'过程显示
'用循环语句动态显示骰子滚动效果(30次) Label_Num1/Label_Num1/Label_Num1
'--------------------------------Begin-------------------------------------
'以下是延迟0.1秒的代码
StartTime = Timer '记下开始的时间
While Timer < StartTime + 0.1 '循环等待(秒)
DoEvents '转让控制权,以便让操作系统处理其它的事件。
Wend
'=================================End======================================
'最后显示
'生成3个随机数 Num1/Num2/Num3
'--------------------------------Begin-------------------------------------
'=================================End================= ====================
'显示3个随机数 Label_Num1/Label_Num1/Label_Num1
'--------------------------------Begin-------------------------------------
'=================================End================= ====================
'第三部分
'判断胜负 给win 赋值
'--------------------------------Begin-------------------------------------
' option_small.value=true
' option_big.value=true
'=================================End======================================
'显示信息Label_info(恭喜你/该背时),更新资产 wealth
'--------------------------------Begin-------------------------------------
'If win Then
'else
'End If
'=================================End======================================
'“开始”按钮复原
Command1.Enabled = True
End Sub
Private Sub Form_DblClick()
'游戏重新开始
Form_Load
End Sub
Private Sub Form_Load()
'初始化
Label_wealth.Caption = 1000
Label_info.Caption = "请选择"
Label_Num1.Caption = "6"
Label_Num2.Caption = "6"
Label_Num3.Caption = "6"
Text_bet.Text = "100"
Text_bet.MaxLength = 3
End Sub