假设你panel的ID是“pnl”int iLblCnt = 0;foreach (Control item in this.Controls){if (item.Name == "pnl"){foreach (Control subitem in item.Controls){if (subitem.GetType().Name == "Label"){++iLblCnt ;}}}}可以根据FindContols来找panel里面的空间!
添加回答
举报
0/150
提交
取消