Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am making an application in C# windows form,, I have two Form (form1 and form2).
Form1 consist of button,, If I click the Form1 button then Form2 is open and Form1 will is close,, then problem is form2 is open but form1 will not close,, Plz help what i do,,,,,,,,
Posted

1 solution

i assume you have a button in form1 named button1.then try this..
C#
private void button1_Click(object sender, EventArgs e)
{
    this.Hide();           //this will hide form1
    Form2 f2 = new Form2();
    f2.Show();             //this will show form2
}
 
Share this answer
 
Comments
Arsalaan Ahmed 29-Aug-12 4:33am    
Thanx Bro, Problem Solve,,,,,,
ridoy 29-Aug-12 6:12am    
glad to help you..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900