本帖最后由 u013730850 于 2014-02-27 09:56:20 编辑

解决方案 »

  1.   

      删除控件中的Lable  TextBox
      

  2.   

    //调用
    RemoveControls(this);public void RemoveControls(Control where)
        {
            foreach (Control c in where.Controls)
            {
                if (lbl  is Label)
                        {
                            where.Controls.Remove(lbl);
                        
                        }                    if (lbl is TextBox)
                        {
                            where.Controls.Remove(lbl);                    }
    if (c.Controls.Count > 0)
                {
               RemoveControls(c)
    }
            }
        }
      
    *****************************************************************************
    签名档: http://feiyun0112.cnblogs.com/
      

  3.   

      
                    foreach (Control lbl in pxsInfo.Controls)
                    {
                        MessageBox.Show(lbl.Text);
                        pxsInfo.Controls.Remove(lbl);
                        //if (lbl  is Label)
                        //{
                        //    pxsInfo.Controls.Remove(lbl);
                        
                        //}                    //if (lbl is TextBox)
                        //{
                        //    pxsInfo.Controls.Remove(lbl);                    //}                }
      这样都不行,,,,