foreach (var item in this.panel1.Controls)
{
if (item is Label)
MessageBox.Show((item as Label).Text);
}这是遍历panel中的所有label控件
var labels = this.Container.Controls.OfType
把Lable放在一个容器里面,比如panel
用findcontrol遍历