In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
Under Project Application Properties it gives you the option to select Startup Form but no option to say use VB Module Subroutine instead? :cool:
You could do this in VB6, any ideas guys? I'm new to VB.NET.
Or is it that your vb.net applications have to start of in a Form?
Thanks :thumb: :ehh:
Rag
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
Turn off the Enable Application Framework.... then create a sub New in your module. Then you'll be able to select it as the start up point.
-tg
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
Thats great thanks mate
:thumb: :thumb:
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
That is generally a bad idea. There really are very few legitimate reasons to have to do that. In almost all cases you should leave the application framework enabled, leave your startup object as a form and simply handle the Startup event of the application. That event is raised BEFORE the startup form is created, so that's where you can, and should, do any processing that needs to be done prior to the main form being created. An example may be having the user log in. You display a login dialogue from the Startup event handler. If the login is successful you do nothing and the app starts normally. If the login fails then you set e.Cancel to True and the app will exit gracefully without ever creating the startup form.
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
I agree with John.
The application startup event is for all intensive purposes the same thing as a sub main.
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
Quote:
Originally Posted by kleinma
I agree with John.
The application startup event is for all intensive purposes the same thing as a sub main.
Yes, for all intents and purposes it is. ;)
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
Sorry my fingers work about 1.8x the speed of my brain on most days ;)
English is my second language.. VB is my first
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
Quote:
Originally Posted by kleinma
English is my second language.. VB is my first
:afrog:
Re: In VB.NET 2005 how do u specify Module Subroutine as Application startup routine?
Thanks for the additional info..
More in this article:
http://visualbasic.about.com/od/usin...nRoutine01.htm
Was wondering why form.show from my module subroutine would now open the form for long. Article explains it.
Thanks for raising the point regarding the use of app events :thumb: