日期:2014-05-17 浏览次数:20885 次
Label[] arrLabel = this.Controls.OfType<Label>().ToArray();
foreach (Label lbl in arrLabel)
{
string sIndex = lbl.Name.Substring(5, lbl.Name.Length - 5);
Control[] arr = this.Controls.Find("textBox" + sIndex, false);
{
TextBox txt = arr[0] as TextBox;
txt.Name = lbl.Text;
}
}
Label[] arrLabel = this.Controls.OfType<Label>().ToArray();
foreach (Label lbl in arrLabel)
{
//
if (lbl.Name.Length > 5 && lbl.Name.Substring(0, 5) == "label")
{
string sIndex = lbl.Name.Substring(5, lbl.Name.Length - 5);
int iIndex = 0;