|
|
Joined: Dec 1999
Posts: 30,867
Master Elite Member
|
This code shows how to start an application without displaying a startup form using the application framework in VB 2005 This is pretty cool and makes your startup code more flexible. Steps for generating this in VB 2.0 a. Create new VB windows forms application b. Select Project->Add Module menu item Name the Module "Program.vb" (the name doesnt actually matter) c. Open up "Program.vb" in the code editor d. Add the following lines <STAThread()> Sub Main()
MessageBox.Show("Now calling main!")
Application.Run(new Form1)
End Sube. In the solution explorer, double click on My Project f. Uncheck the "Enable Application Framework" checkbox g. Change the Startup object to "Sub Main" h. Save and run the app. Verify you see "Now calling main!" messagebox. i. Now we've got a main, you can write your own application context and replace the code in Sub Main to use your own Application Context. <STAThread()> Sub Main()
Dim applicationContext As MyApplicationContext
applicationContext = New MyApplicationContext()
Application.Run(applicationContext)
End Sub Class MyApplicationContext
Inherits System.Windows.Forms.ApplicationContext
' To be implemented...
End Class Source: http://blogs.msdn.com/jfoscoding/archive/2005/08/24/455579.aspx
|
|
|
|
Entire Thread
|
Starting An Application Without A Startup Form (Using the Application Framework in VB 2005)
|
Russ
|
09/17/08 07:00 AM
|
|
|
|