Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows Win7 VB.NET
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 27-Feb-13 6:23am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
KingsKnight1 at 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 at 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)

  Print Answers RSS
0 Schatak 394
1 OriginalGriff 355
2 _Amy 115
3 Sergey Alexandrovich Kryukov 109
4 Andreas Gieriet 100
0 OriginalGriff 7,097
1 Sergey Alexandrovich Kryukov 5,623
2 Maciej Los 3,504
3 Peter Leow 3,373
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 27 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100