string strLabelNum = "lab_" + iNum.ToString();
Control[] cLabel = pnl.Controls.Find(strLabelNum, true);
Label lblTop = (Label)cLabel[0];
lblTop.Left = pnl.Width / 2 - 5;
lblTop.Top = pnl.Height / 2 - 5;
lblTop.Text = Convert.ToString(picnum.iPageFirstNum + iNum - 1);
lblTop.BringToFront(); lblTop.Refresh();
wpf中:
this.FindName("控件名称");