Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close form without exit application

Tags:

c#

windows

I'm currently working on a small project and would like some help on it.

I have 2 forms, the first is a login window and the second will be the main program. The problem I have is that when I close form1 with this.Close() it is exiting the whole program.

I have a feeling that I need to use threading or something like that but I can't find the right resource for my problem to be solved.

Thanks.

like image 366
Victor Bjelkholm Avatar asked Aug 09 '10 18:08

Victor Bjelkholm


1 Answers

If you're using WPF, you can set Application.MainWindow to your second "main" window, prior to closing your login form.

like image 112
Reed Copsey Avatar answered Oct 23 '22 14:10

Reed Copsey