我正在尝试在 Visual Basic 中使用 Slots Machine 类型的程序,我已经检查了基本的插槽机制并使用
Private Sub roll_Click(sender As Object, e As EventArgs) Handles roll.Click
a.Text = CStr(Int(Rnd() * 10))
b.Text = CStr(Int(Rnd() * 10))
c.Text = CStr(Int(Rnd() * 10))
If a.Text = 7 And b.Text = 7 And c.Text = 7 Then
MessageBox.Show("WINNER!")
Else
MessageBox.Show("Sorry, you are not a winner.")
End If
End Sub
但我想在辅助文本标签中引用此单击事件。例如,如果单击按钮,它会跟踪您单击了多少次。就像我在想:
Private Sub amountlabel_Click(sender As Object, e As EventArgs) Handles amountlabel.Click
for roll.Click do
amount.Text = + 1
End For
End Sub
谁能帮忙谢谢!