0

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~

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Usmaan
0

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.

Edited by Mitja Bonca: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.