jeudi 5 novembre 2020

I have just started learning c# and I am having trouble making a random number generator Anyone's help is appreciated [closed]

namespace RandomNumberGenerator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = "0";
            Random rnd = new Random();
            for (decimal i = 1; i <= 10; i++)
            {
                label1.Text = rnd.Next("textBox1", "textBox2");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label1.Text = "0";
        }
    }
}



Aucun commentaire:

Enregistrer un commentaire