Saturday, 29 December 2012 13:56

how to create login by running multiple subsequent forms in c#

Written by 
Rate this item
(0 votes)

it is possible to run Application.Run twice in csharp
application.the following example shows's a
example to create login to access the application.

first a login form is created with the username and
password texboxes and two buttons login and
cancel.these button handlers sets the DialogResult
property for the login button sets it to
DialogResult.Ok and cancel button sets it to

the main program.cs file does all as follows -

static class Program
private static FormSplash formSplashObj = null;

static void Main()

formSplashObj = new FormSplash();
if (formSplashObj.DialogResult == DialogResult.OK)
Application.Run(new MainForm());

the above program responsible for running the splash
form and when it quit, the program determines
whether it will exit the application or run next form.
so this provide a login for the application.

Read 2751 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.