Create Form : LoginForm , MainForm
Program.cs
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
LoginFrm loginFrm = new LoginFrm();
if (loginFrm.ShowDialog() == DialogResult.OK)
{
Application.Run(new MainFrm());
}
}
}
LoginForm.cs
private void button1_Click(object sender, EventArgs e)
{
//Login Check
this.DialogResult = DialogResult.OK;
}
Other:
1.LoginForm property "FormBorderStyle" :None ; "StartPosition":centerscreen
AcceptButton : LoginButton;CancelButton:CancelButton
Program.cs
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
LoginFrm loginFrm = new LoginFrm();
if (loginFrm.ShowDialog() == DialogResult.OK)
{
Application.Run(new MainFrm());
}
}
}
LoginForm.cs
private void button1_Click(object sender, EventArgs e)
{
//Login Check
this.DialogResult = DialogResult.OK;
}
Other:
1.LoginForm property "FormBorderStyle" :None ; "StartPosition":centerscreen
AcceptButton : LoginButton;CancelButton:CancelButton