我有2個數組,我想要排序,但保持元素對齊正確。例如,元素[x]上的button1與元素[x]上的textbox1保持一致。這可能是另一個我可以使用的結構,但我無法弄清楚。同時排序2個數組
String[] Teams = {
textBox1.Text, textBox2.Text, textBox3.Text,
textBox4.Text, textBox5.Text, textBox6.Text,
textBox7.Text, textBox8.Text, textBox9.Text
};
int[] Scores = {
Convert.ToInt32(button1.Text), Convert.ToInt32(button2.Text), Convert.ToInt32(button3.Text),
Convert.ToInt32(button4.Text), Convert.ToInt32(button5.Text), Convert.ToInt32(button6.Text),
Convert.ToInt32(button7.Text), Convert.ToInt32(button8.Text), Convert.ToInt32(button9.Text)
};