using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
List<Button> myList = new List<Button>();
Random myRandom = new Random();
public Form1()
{
InitializeComponent();
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
button5.Enabled = false;
button6.Enabled = false;
button7.Enabled = false;
button8.Enabled = false;
button9.Enabled = false;
myList.Add(button1);
myList.Add(button2);
myList.Add(button3);
myList.Add(button4);
myList.Add(button5);
myList.Add(button6);
myList.Add(button7);
myList.Add(button8);
myList.Add(button9);
}
private void button10_Click(object sender, EventArgs e)
{
Random rand = new Random();
int number = rand.Next(0, 10);
for (int i = 0; i < 9; i++)
{
number++;
if (number >= 10)
{
number -= 10;
}
myList[i].Text = number.ToString();
}
}
}