I need help in trying to generate a random number because with my coding below it shows the same number in both text boxes.
private int RandomNumber(int min, int max)
{
Random random = new Random();
random.Next();
return random.Next(1, 7); // random integer and assigned to number
}
private void button1_Click(object sender, EventArgs e)
{
tb1.Text = RandomNumber(1, 7).ToString(); // Random Number for Text Box 1.
tb2.Text = RandomNumber(7, 1).ToString(); // Random Number for Text Box 2.
}
1, 7hardcoded in yourRandomNumberroutine. Also you have7, 1coded in one of your calls to this routine; which is probably the wrong way round given the parameter names.