Friday, January 17, 2014

Search a Control using Key

  GroupBox objGrpBox = null;
           String sGroupBoxName = "GroupBox";

           
               if (SplitContnerEpub.Panel1.Controls.ContainsKey(sGroupBoxName))
               {
                   objGrpBox = SplitContnerEpub.Panel1.Controls[sGroupBoxName] as GroupBox;
                   objGrpBox.Controls.Clear();
               }
               else
                   objGrpBox = new GroupBox();
                           
               objGrpBox.Name = sGroupBoxName;


No comments:

Followers

Link