HOW TO OPEN 3RD FORM IN 1ST FORMS PANEL

Manmohan Jha

Total Post:35

Points:245
Posted by  Manmohan Jha
C# 
C#
 1659  View(s)
Ratings:
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...

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: How to Open 3rd Form in 1st Forms panel

    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();
            }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!