Show a form from another form

Posted by M.H on Stack Overflow See other posts from Stack Overflow or by M.H
Published on 2010-04-11T21:50:24Z Indexed on 2010/04/11 21:53 UTC
Read the original article Hit count: 157

Filed under:

Hi,When I want to Display a from (C#) by clicking a button in another form I usually create an object form the form that I want to show and use the show method :

        Form2 f2 = new Form2();
        f2.Show();

or I work with the "Owner" :

        Form2 tempForm = new Form2();
        this.AddOwnedForm(tempForm);
        tempForm.Show();

the tow ways generate the same results but what is the best and what are the differences between them?

© Stack Overflow or respective owner

Related posts about c#