|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Application.RunI have an app which starts using Application.Run(...........); I want to create a logon screen, prior to the main app running, so I modified my main() to look similar to frmLogon logon = new frmLogon(); logon.ShowDialog(); //Check for valid logon // If valid logon, start the main app Application.Run(new frmMain()); logon=null; My question is..... why do I need to use Application.Run ?? Should my logon prompt reside IN the application.run form, or outside it?? Thanks Paul Application.Run() handles the Windows message loop for frmMain().
Without it, your form won't be responsive to user input. As for logon.ShowDialog(), modal dialogs have their own message loop, so it really doesn't matter where you put it. However, you might want to explicitly pass the owner of the dialog as a paremeter to ShowDialog(). In that case, you need to put it inside the form. Oh, and for modal dialogs, you need to call Close/Dispose(), they aren't disposed when the user closes them. Regards Senthil
Other interesting topics
strong naming fails if delay signed
When does a Windows Form create it's message processing thread CLR Bug ?! GUID for .Net framework GenericPrincipal serialization. Encryption algorithms for product licensing Release date for .NET 2.0 Including MSDE in Windows package, containing C# app Update for .NET Framework - "you can't get there from here" Protecting code |
|||||||||||||||||||||||