代码如下:
我就是想做一个随机的抽奖程序~,代码如下:
Private Sub Form_Load()
Randomize
Label1.Visible = False
Label1.Caption = 1 + Int(Rnd * 10)
End Sub
Private Sub Command2_Click()
Dim i As Integer
If Text1.Text = Label1.Caption Then
MsgBox "恭喜你~!"
Text1.Text = " "
Text1.SetFocus
Else
i = MsgBox("很遗憾", 5 + 48)
Text1.Text = " "
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
Label1.Visible = True
Text1.SetFocus
End Sub
Private Sub Command3_Click() ' 想通过这个按钮来重新运行程序,反正就是想输完一次之后能继续进行下去,
Form_Load 该如何实现呢?
Text1.SetFocus
End Sub