Hi,
I have two forms,
Form1, Form2
I need to show form2 first and then add form1 to form2. I did this in program.cs
Passing form2 object to form1 in constructor. am assigning the properties of form2 in form1 using the constructor object.
static class Program
{
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form2 frm2 = new Form2();
Form1 frm = new Form1(frm2);
frm.TopLevel = false;
frm2.Controls.Add(frm);
frm.Show();
frm.Activate();
frm.BringToFront();
Application.Run(frm2);
}
}
Problem is(frm2.show()), after assigning all the properties I could not reload the form2. coz form2 is already initialized and this line is not hitting the form2_load.
frm2.name="xxx";
frm2.show();
Please help me with this.