Click here to Skip to main content
12,817,428 members (33,534 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB 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

Posted 27-Feb-13 7:23am

1 solution

Rate this: bad
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:[^].

For some background, see also:[^],[^].

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?
Sergey Alexandrovich Kryukov 27-Feb-13 14:19pm
Read more carefully. This is exactly what you need.

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170308.1 | Last Updated 27 Feb 2013
Copyright © CodeProject, 1999-2017
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