public Form1() { InitializeComponent(); objAddPerson AddPerson = new objAddPerson(); LoadControls(AddPerson, "Add Person"); }
private void radAddWorker_CheckedChanged(object sender, EventArgs e) { if (radAddWorker.Checked == true) { objAddPerson AddPerson = new objAddPerson(); radFindWorker.Checked = false; objPanel.Controls.Clear(); objPanel.Controls.Add(AddPerson); this.ActiveControl = objPanel; ActiveControl = AddPerson; ActiveControl.Focus(); } }