usercontrol in splitcontainer: help

Apr 10 2007 9:22 AM
Hi all, a n00b question regarding controls in a splitcontainer. I have a form (name it form1) with a splitcontainer containing 2 panels (panel1 and panel2). UserControlX is a usercontrol-form which is loaded in panel1 when form1_load(s). UserControlX-form has a buttonA. When i click on buttonA, form3 (another form) should be loaded in panel2: this is where i don't get it. The buttonA has the code: 

form3 x = new form3();
//temp = solution name
temp.form1.splitContainer1.Panel2.Controls.Add(x);

x.Show();

The error i get for splitcontainer1 =  "is inaccessible due to its protection level "

ps. when the button is placed within panel1 (realtime in the form), said code works. instead of temp.form1, "this." is used.

can someone help me out with this.

ps. this is not a MDI thing..

Answers (2)