0% found this document useful (0 votes)
28 views1 page

Blagin

Uploaded by

Sandara C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

Blagin

Uploaded by

Sandara C.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

}

private void chkShowPassword_CheckChanged(object? sender, EventArgs e)


{
if (chkShowPassword.Checked)
{
txtPassword.PasswordChar = '\0';
}

else
{
txtPassword.PasswordChar = '*';
}
}

private void btnLogin_Click(object? sender, EventArgs e)


{
string username = "admin";
string password = "admin";
string form2Username = txtUsername.Text;

if (txtUsername.Text == username && txtPassword.Text == password)


{
MessageBox.Show("LOGIN SUCCESSFULLY!");

Form2 form2 = new Form2(form2Username);


form2.Show();
}

else
{
MessageBox.Show("Invalid Username or password.");
}

//// FORM 2 //////

public Form2(string form2Username)


{
InitializeComponent();

Label lblUsername = new Label();

this.Controls.Add(lblUsername);

lblUsername.Text = "Username: " + form2Username;


lblUsername.Location = new Point(12, 22);
lblUsername.Font = new Font("Segoe UI", 16, FontStyle.Bold);
lblUsername.ForeColor = Color.Black;
lblUsername.AutoSize = true;

You might also like