XTab's Blog

Ged Mead's Blog at vbCity

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

AprMay 2008Jun
SMTWTFS
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

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

Post Feedback

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