我想扫描一些序列号以只读文本框。我创建了一个文本框列表,但我不知道如何按文本框名称对它们进行排序:
// This gets all the textboxnames ands makes an array of names and textboxes
foreach (Control groupbox in this.Controls)
{
if (groupbox is GroupBox)
{
foreach (Control textbox in groupbox.Controls)
{
if (textbox is TextBox)
{
theTextBoxesList.Add((TextBox)textbox);
TextBoxNames.Add(textbox.Name);
}
}
}
}
TextBoxNames.Sort();
theTextBoxesList.Sort?????