Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a Windows form application to which I'm adding a Login form. What I want to do is run the login form first and if the userid and password are authenticated, display the main form and close the Login form. I thought I would do this from a Sub Main procedure in a code module. But I can't find a way to force the Sub Main to execute first. The Application tab on the Properties page only allows for a Startup form, not a Sub Main. Is there another way to do this? Any suggestions?

Thank you

-jps
Posted

1 solution

Normally, you don't need anything to do about it, if you, for example, created an application from Visual Studio template. Entry point is only applicable for application assembly types, no class library (check up project Properties window, "Application" tab). The only real difference between application and library assembly is the availability of the entry point static method; but you can reference all types of assembly as libraries, if you want to.

Entry point is explained here: http://msdn.microsoft.com/en-us/library/f5xe74x8.aspx[^].

For some background, see also: http://en.wikipedia.org/wiki/Main_function[^],
http://en.wikipedia.org/wiki/Entry_point[^].

—SA
 
Share this answer
 
Comments
KingsKnight1 27-Feb-13 14:15pm    
I'm sorry but this does not seem to answer my question. How do I code a Sub Main in a code module of a Windows application so that it execuctes first?
-jps
Sergey Alexandrovich Kryukov 27-Feb-13 14:19pm    
Read more carefully. This is exactly what you need.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900