Here, the Red Player and Blue Player will throw the Dice. The Red and Blue colored dice bounces and shows a random number from 1 to 6. The throw number and their individual scores are shown through labels beside them. The score label shows the total by adding up the score of each throw.
What I want to do is to show the name of the winner (Red Player/Blue Player is the winner!) through a messagebox. I think I should use a Do Until Loop to show the winner, but i'm confused how?
The messagebox needs to appear when the decided number of throws beside the play button matches the throw number of blue player.
The names are -
Label beside the Play button - lblThrow
Red Player Throw number Label - lblRedThrow
Blue Player Throw number Label - lblBlueThrow
Blue Player Throw button - btnBlueThrow
Below is the code i've tried
Private Sub btnBlueThrow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBlueThrow.Click
Do Until lblThrow.Text = lblBlueThrow.Text
MessageBox.Show("The winner is Winner")
Loop
End Sub
It freezes the whole window when I click the Blue Player Throw button only once.

New Topic/Question
Reply




MultiQuote





|