0

I'm trying to make a button on my windows form create a new page when clicked, something like when you are going through an installation of a program and you would click "Next" and it would take you to a new page but not bring up an entirely seperate window. I would also have another button that would be pressed to bring up the original form.

I've looked everywhere for a answer to this so any help on how I would create this would be greatly appreciated.

private void Cleaning_Click(object sender, EventArgs e)
{
    // executes new page    
} 
Woot
  • 31
  • 1
  • 1
  • 6

3 Answers3

1

What you want to do is to create a wizard. There are lot of samples on internet regarding that. Take a look;

http://www.codeproject.com/Articles/31770/Wizard-Form-Implementation

Or

You can see that SO question

Creating Wizards for Windows Forms in C#

Community
  • 1
  • 1
husnain_sys
  • 571
  • 4
  • 14
0

One simple way is to use panels in a single form. The only problem with panels is that it is hard to edit the layout and also your code would become very messy.

it IS simple BUT has a very bad downside

Jan Lyndon Jasa
  • 162
  • 1
  • 10
0

Simply we can add one groupbox and add your controls, in form load set groupbox visible to false and button click event visible to true something like....

 private void Form3_Load(object sender, EventArgs e)
    {
        groupBox1.Visible = false;
    }

    private void button1_Click_1(object sender, EventArgs e)
    {
        if (button1.Text == "&Show")
        {
            button1.Text = "&Hide";
            groupBox1.Visible = true;
        }
        else if (button1.Text == "&Hide")
        {
            button1.Text = "&Show";
            groupBox1.Visible = false;
        }
    }
senthilkumar2185
  • 2,536
  • 3
  • 22
  • 36