Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27072

VS 2012 Making a Dice Roller Application, need help

$
0
0
So my application (obviously) rolls dice (virtually). I've got the sides of the dice working, so you could roll a 19835-sided dice and get a result. But I'm not exactly sure how to roll multiple dice using the same random.... <code below>

Public Class frmMain

Private Sub btnRollDice_Click(sender As Object, e As EventArgs) Handles btnRollDice.Click
Dim rnd = New Random()
Dim nextValue = rnd.Next(txtSides.Text)
lblRollResult.Text = nextValue.ToString

End Sub
End Class

So just so that way nobody gets confused, here's a list of the interactive items..


btnRolldice - button, working everything inside here
txtSides - enabled text box, used to limit the random to a certain number
lblRollResult - label that gives the result, no biggy

So I want to be able to use another text box to determine the number of dice rolled, and make sure it will give me different numbers using the same random. I appreciate any help, and if you'd like the finished product, email me <cornhater@gmail.com>

Viewing all articles
Browse latest Browse all 27072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>