示例#1
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            if (userNameBox.Text == Form1.username && passwordBox.Text == Form1.password)
            {
                Form f = this.FindForm();
                f.Controls.Remove(this);

                welcomePage wp = new welcomePage();
                f.Controls.Add(wp);
            }

            else
            {
                userNameBox.Clear();
                passwordBox.Clear();

                failedLabel.Visible = true;
            }
        }
示例#2
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            if (userNameBox.Text == Form1.username && passwordBox.Text == Form1.password)
            {
                Form f = this.FindForm();
                f.Controls.Remove(this);

                welcomePage wp = new welcomePage();
                f.Controls.Add(wp);
            }

            else
            {
                userNameBox.Clear();
                passwordBox.Clear();

                failedLabel.Visible = true;
            }
        }