Using Windows Forms I would like to have a small login screen the user authorizes himself/herself through (say its Form1), so the main application (say its Form2) would be opened after login. But I suppose when I use Application.Run(Form1), after closing it the whole application closes.
Isn't there any other way except using invisible Form2?
Something like run Form2 on demand and close originally ran Form1? Hope it makes sense to you 🙂
Best Answer
Create an overload of
System.Windows.Forms.ApplicationContext
, createForm1
first and thenForm2
in its constructor.Use
Application.Run
overload that acceptsApplicationContext
object.