Results 1 to 3 of 3

Thread: [RESOLVED] [2005] "Proper" way to start an application

  1. #1

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Resolved [RESOLVED] [2005] "Proper" way to start an application

    In Visual Basic 6, the "proper" way to start an application was to use a module and Sub Main then declare a new instance of your main form, then show it, then dispose of it. Is there something like this in VB .NET?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: [2005] "Proper" way to start an application

    VB 2005 has the application framework to make your life easier. It is enabled by default and handles things like enabling visual styles, saving application settings and creating a single instance application, all with check boxes in the IDE. If you want to do something special when your app starts (the sort of thing you would have done in a Main method previously) then press the View Application Events button and create an event handler for the Startup event. This allows you to peform operations before the startup form is created. You can also perform validation, like logging in, in this event handler and if it fails you can prevent the startup form being created through the 'e' parameter, thus aborting the application.

    You can disable the application framework if you want and create your own Main method but I can't think of a valid reason to do so. Options relating to the application framework can be found on the Application tab of the project properties.

  3. #3

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [2005] "Proper" way to start an application

    Thats cool. I like the whole idea of having events for when your application starts up and shuts down. Feel more... clean. Just like everything else in 2005.

    Thanks JMC!
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width