C# 有6个Textbox如何输入不同数字

来源:百度知道 编辑:UC知道 时间:2024/05/31 14:35:24
现有6个Textbox,我想输入不同的6个数字怎么办,如何写判断.
就是说,每个Textbox在输入的时候都要先与其他5个比较判断后再输入.
比如:
第一个Textbox输入1之后,后面的5个都不能输入1.
后面5个Textbox里面任意一个输入了1,那么第一个Textbox就不能输入1.
前面5个Textbox分别输入1,2,3,4,5后,第6个Textbox就不能输入1,2,3,4,5.
有点乱了~~~不知道怎么写了~~~

各位帮帮忙~~我第一次在这里提问的~~~~~~~
小花的我看不懂啊,groupBox_KeySet是什么东西,是把6个textBox放进一个groupBox里?
我想要得是相同数字不准输入,不是把原来的去掉阿。
就是说
如果有重复则不许输入,比如“上”本来是“w”
如果你设置“下”为“w”的话,根本就不让你输入。
怎么办?

晕!!自己不让回答自己的阿!
我刚才自己写的,感觉麻烦,不过解决了
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text == textBox2.Text || textBox1.Text == textBox3.Text || textBox1.Text == textBox4.Text || textBox1.Text == textBox5.Text || textBox1.Text == textBox6.Text)
{
textBox1.Text = string.Empty;
}
}

private void textBox2_TextChanged(object sender, EventArgs e)
{
if (textBox2.Text == textBox1.Text || textBox2.Text == textBox3.Text || textBox2.Text == textBox4.Text || textBox2.Text == textBox5.Text || textBox2.Text == textBox6.Text)
{
textBox2.Text = string.Empty;
}
}

private void textBox3_TextChanged(object sender, EventArgs e)
{
if (textBox3.Text == textBox1.Text || textBox3.Text == textBox2.Text || textBox3