XTab's Blog

Ged Mead's Blog at vbCity

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

OctNovember 2009Dec
SMTWTFS
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Archives

Topics

Ramblings

VB.NET

As I've said on many occasions in the past, it's those sometimes tiny little Gotchas that will cause you the greatest amount of aggravation. Here's one that I've been meaning to blog for a while now. It's a question/problem that comes up fairly often and it usually goes something like this:-

"In a Windows Forms project, I add a module that has a Sub Main procedure in it. I want to use this Sub Main as the StartUp Object in the application. But when I look in the project properties, I don't see "Sub Main" as a choice. "

No Sub Main Listed
"It used to be here in earlier editions - where has it gone to and how can I access it? "

The solution to this particular Gotcha is very easy.

Open up the Project Properties page.
Home in on the "Enable Application Framework" CheckBox.

Enable Application Framework
Uncheck this option (i.e. disable it)

Now if you view the "Startup Form" combo you'll see that it has changed so that it reads "Startup Object".
Click on the combo and all the forms plus the module and the Sub Main inside that module will all be available as Startup objects.


Sub Main Now Listed

It's one of those "simple when you know" things that'll drive you mad if you don't!

posted on Tuesday, June 19, 2007 1:02 PM

Feedback

# re: VB 2005: The "Missing" Sub Main Problem 11/7/2007 11:52 AM fil
you're a legend !
many thanks

# re: VB 2005: The "Missing" Sub Main Problem 11/24/2008 5:46 AM SE
Ugh, thanks, I was going in circles trying to figure out the missing Sub Main, and I would have NEVER figured that out.

Great post, thanks!

# re: VB 2005: The "Missing" Sub Main Problem 6/25/2009 10:55 PM Dave Grohl
Cheers Dude, thanks for posting up this tip

# re: VB 2005: The "Missing" Sub Main Problem 10/6/2009 8:32 AM Ryan
Great help!

Post Feedback

Title:
Name:
Url:
Comments: 
Protected by Clearscreen.SharpHIPEnter the code you see: