Hi there,

If I have two Forms, for example: Form1.cs and Form2.cs and one Form1, there is a button which if clicked, it would close Form1 and open Form2.

How would you go about doing that? And is there any better way of implementing this?

(This is something I'm considering to start from making a booking system or something similar).

Usmaan~

Recommended Answers

All 2 Replies

You can hind Form1, and open form2.

//on button click:
Form2 f2 = new Form2();
this.Hide();
f2.Show();

If you will close or dispose Form1, the whole application will close, thats because in Program class you called "Application.Run(new Form1());" so this holds up everything.

Works like magic. Thank you!

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.