Hi there. I was wondering how I would add another form to my Form1 in a WFA project. And then when I click on a button on Form1, Form2 pops up.

I have no idea on how to do this and I was wondering if anyone knew =]

Thanks for the help!

Pretty sure its as simple as

Application.Run(new FORMNAME();

So I just need to type this in my button:

Application.Run(new Form2());

?

edit: i tried it, but it didn't work =[

Do something like this in your button click:

Form SecondForm = new Form();
SecondForm.Show();

oh sweet, thanks dude =]
I got it working! ^^

private void button1_Click(object sender, EventArgs e)
        {
            Form2 formtwo = new Form2();
            formtwo.Show();
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.