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
{
Random rnd = new Random();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button10_Click(object sender, EventArgs e)
{
int a = rnd.Next(1, 10);
int b = rnd.Next(1, 10);
int c = rnd.Next(1, 10);
int d = rnd.Next(1, 10);
int f = rnd.Next(1, 10);
int g = rnd.Next(1, 10);
int h = rnd.Next(1, 10);
int i = rnd.Next(1, 10);
int j = rnd.Next(1, 10);
button1.Text = a.ToString();
button2.Text = b.ToString();
button3.Text = c.ToString();
button4.Text = d.ToString();
button5.Text = f.ToString();
button6.Text = g.ToString();
button7.Text = h.ToString();
button8.Text = i.ToString();
button9.Text = j.ToString();
while (button1.Text == button2.Text || button1.Text == button3.Text || button2.Text == button3.Text)
{
MessageBox.Show("他們一樣ㄌ。。。。");
button1.Text = rnd.Next(1, 10).ToString();
button2.Text = rnd.Next(1, 10).ToString();
button3.Text = rnd.Next(1, 10).ToString();
}
}
private void button1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
}
}
}
沒有留言:
張貼留言