|
-
Mar 2nd, 2011, 09:44 PM
#1
Thread Starter
Addicted Member
Sub Main ?
how solutions to the sub main that is in VB6.
because there is no facility in VB.NET?
-
Mar 2nd, 2011, 09:56 PM
#2
Re: Sub Main ?
There's almost never a need to use a Sub Main. In a VB 2008 application, the Application Framework is enabled by default. It provides a Startup event, which you can handle to perform actions before the startup form is created. It also provides a Shutdown event, which you cam handle to perform actions after the last form has closed. There are various other events and functionality available too. If you explain what you're trying to achieve then we can explain the best way to achieve it.
In the very few situations where you really need to create your own Sub Main, you need to disable the Application Framework first, which allows you to select a Startup Object instead of a Startup Form.
-
Mar 2nd, 2011, 10:02 PM
#3
Thread Starter
Addicted Member
Re: Sub Main ?
I want the first time he read the sub Main running play.
because in sub Main play is there some process that needs to be done.
include: open database connection, call and other.
Public Sub Main()
Call OpenDatabase()
Call APPConfig()
frmLogin.ShowDialog()
End Sub
Last edited by Tengkorak; Mar 2nd, 2011 at 10:25 PM.
-
Mar 2nd, 2011, 10:06 PM
#4
Re: Sub Main ?
 Originally Posted by jmcilhinney
It provides a Startup event, which you can handle to perform actions before the startup form is created
I think jmclongname had that covered.
-
Mar 2nd, 2011, 10:14 PM
#5
Thread Starter
Addicted Member
Re: Sub Main ?
Can give me a way to do this?
-
Mar 2nd, 2011, 10:42 PM
#6
Re: Sub Main ?
 Originally Posted by Tengkorak
Can give me a way to do this?

If you read my previous post properly then already have it:
[the application framework] provides a Startup event, which you can handle to perform actions before the startup form is created.
Not that it would be hard to find others if you would care to search, but you can find an example by following the CodeBank link in my signature and checking out my WinForms Login thread.
-
Mar 2nd, 2011, 11:39 PM
#7
Thread Starter
Addicted Member
Re: Sub Main ?
thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|