Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   How to hide form when 2nd Form opens? (http://www.go4expert.com/forums/hide-form-2nd-form-t4319/)

shah123 15May2007 21:40

How to hide form when 2nd Form opens?
 
I have a form where there is a button and i want to launch an another form by the help of that button which is done but when second form opens it doesnt close the first one as i did many tries.

Following is my code snippet
Code:

private void LoadGameButton_Click(object sender, EventArgs e)
        {
            TicTacToe tic=new TicTacToe();
            tic.Show();
            log = new Login();
            log.Close(); // or i tried hide and different ways here but still login form appear

        }

Please help

shabbir 15May2007 21:58

Re: How to hide form when 2nd Form opens?
 
You need to close before the show.

shah123 16May2007 14:06

Re: How to hide form when 2nd Form opens?
 
TicTacToe tic=new TicTacToe();
tic.Show();
this.Hide();

This was the solution. Thanks Shabbir


All times are GMT +5.5. The time now is 23:17.