Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I can add a Sub Main to a module as a start point for the application, as I would have done in VB6, but I can't figure out how to specify that this is where the application is to start. The listbox under Application Properties/Application/StartUp Form only allows me to select forms. So how do I do this?
Posted

If you want to start from Sub Main

 

Click on Project, drag and click onto Properties

Under 'Common Properties' ---> 'General'

 

There is a list box under 'Startup Object'

Drag to 'Sub Main'

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi
Posted (edited)
If you want to start from Sub Main

 

Click on Project, drag and click onto Properties

Under 'Common Properties' ---> 'General'

 

There is a list box under 'Startup Object'

Drag to 'Sub Main'

Attached is what my screen looks like. Unfortunately, I can't tie in what you're saying with that at all. Under WindowsApplication1 I can get a Properties menu item, clicking on that shows me the properties as displayed in the attachment. That has a Startup form dropdown but this only allows forms to be selected, not Sub Main.

 

I have 2005 Express Version, you probably have a different one.

Edited by PlausiblyDamp
Posted

Yeah I have 2003. So couldn't tell you in 2005 express. I am going to have to download it when I get home for my home computer.

 

So where it says startup form, I take it there isn't an option to start at 'Sub Main'?

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi
Posted
Yeah I have 2003. So couldn't tell you in 2005 express. I am going to have to download it when I get home for my home computer.

 

So where it says startup form, I take it there isn't an option to start at 'Sub Main'?

Nope. The help file says in relation to Sub Main:

Windows Forms applications run on their own. However, the Visual Basic compiler automatically generates a Main procedure in such an application, and you do not need to write one.
I've looked everywhere including Application.Designer and Form1.Designer and there's no sign of an automatically generated Sub Main. And the help file doesn't tell you how to specify that you want to use one to start the application.
Posted
You have to uncheck "Enable Application Framework" and then the startup form combobox becomes a startup object box, from which you can choose Sub Main.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...