Add controls from one panel to the other

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ken4ward
    New Member
    • Mar 2012
    • 1

    Add controls from one panel to the other

    Code:
    class AllUsers
    public void AllUsers_Load(object sender, EventArgs e)
            {
                new Insert().InsertMe();
            }
    
    //==================================================================
    
    public class Insert : Linkwindow{
            int checkBoxCount = 0;
            public void InsertMe()
            {
                 if (personPanel.Controls != null)
                {
                    Control control = new Control();
                    if (control.GetType() == typeof(RadioButton))
                    {
                            foreach (RadioButton radios in rolePanel.Controls)
                            {
                                new AllUsers().allPersonPanel.Controls.Add(radios);
                            }
                        }
                    }
             }  
        }
    I created 2 panels in 2 different forms to add controls from the personPanel(whi ch pulls it items from the database) to allPersonPanel but to my surprise the code does not seem to achieve this purpose, what should I do? Thanks. God bless in Jesus name.
Working...