Home > DeveloperSection > Forums > How to Open 3rd Form in 1st Forms panel
Manmohan Jha

Total Post:35

Points:245
Posted on    February-13-2014 11:53 PM

 C# C# 
Ratings:


 1 Reply(s)
 1256  View(s)
Rate this:
Fist Forms Button Click:-
Show Second Form in First Forms Panel...

If Second Forms Button Click:-
Then Show 3rd form in First Forms Panel...

How???
Urgent...
Please Help me...



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    February-17-2014 3:16 AM

This is the code in first form button click event to open second form 

 private void button1_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();
            panel1.Visible = true;
            Form2 f1 = new Form2(panel1);
            f1.TopLevel = false;
            f1.AutoScroll = true;
            f1.Show();
            panel1.Controls.Add(f1);
            
        }

here is the coding to open third form in first form panel

Panel panel = null;
        public Form2(Panel panel)
        {
            InitializeComponent();
            this.panel = panel;
        }

private void button1_Click(object sender, EventArgs e)
        {
            Form3 f2 = new Form3();
            panel.Controls.Clear();
            panel.Visible = true;
            f2.TopLevel = false;
            f2.AutoScroll = true;
            f2.Show();
            panel.Controls.Add(f2);
            this.Close();
        }

Don't want to miss updates? Please click the below button!

Follow MindStick