Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This should all be refactored to make it less tightly-coupled, obviously.
- class MyWindowsApplicationBase : WindowsFormsApplicationBase
- {
- internal MyWindowsApplicationBase() : base()
- {
- // This is a single instance application.
- this.IsSingleInstance = true;
- // Set to the instance of your form to run.
- this.MainForm = new MyForm();
- }
- }
- // This should all be refactored to make it less tightly-coupled, obviously.
- public static void Main(string args[])
- {
- // Process the args.
- <process args here>
- // Create the application base.
- MyWindowsApplicationBase appBase = new MyWindowsApplicationBase();
- // <1> Set the StartupNextInstance event handler.
- appBase.StartupNextInstance = <event handler code>;
- // Show the main form of the app.
- appBase.Run(args);
- }
Add Comment
Please, Sign In to add comment