Load your login form in the Main method, but before you actually start the main windows form loop( Application.Run), take alook at the TaskVision as an exmaple
[STAThread] static int Main(string[] args) {
System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler( new ErrorHandler.ErrorService().OnThreadException);
using(LoginForm login = new LoginForm()) { if ( login.ShowDialog() == DialogResult.Cancel) return; else {// process the authentication } }
} }
|