这是我的代码 我想删除 里面的TextBox和Lable控件
foreach (Control lbl in pxsInfo.Controls)
{
MessageBox.Show(lbl.Text);
if (lbl is Label)
{
pxsInfo.Controls.Remove(lbl);
}
if (lbl is TextBox)
{
pxsInfo.Controls.Remove(lbl);
}
}
foreach (Control lbl in picImageUp.Controls)
{
MessageBox.Show(lbl.Text);
if (lbl is Label)
{
this.picImageUp.Controls.Remove(lbl);
}
}
结果如下
希望能得到修改办法