private void bunifuFlatButton2_Click(object sender, EventArgs e) { string user, pass; user = txtuname.Text; pass = txtpwd.Text; if (user == "admin" && pass == "admin") { txtuname.Text = ""; txtpwd.Text = ""; frmdashboard dsb = new frmdashboard(); StudentReg std = new StudentReg(); this.Visible = false; dsb.lblusr.Text = "Admin"; //std.lbluser12.Text = "Admin"; this.Visible = false; dsb.ShowDialog(); } else { lblcolor.Text = "Invalid Username & Password"; lblcolor.ForeColor = System.Drawing.Color.Red; } }
private void timer1_Tick(object sender, EventArgs e) { Random rand = new Random(); int one = rand.Next(0, 255); int two = rand.Next(0, 255); int three = rand.Next(0, 255); int four = rand.Next(0, 255); lblcolor.ForeColor = Color.FromArgb(one, two, three, four); string user, pass; user = txtuname.Text; pass = txtpwd.Text; if (user == "admin" && pass == "admin") { txtuname.Text = ""; txtpwd.Text = ""; lblcolor.Text = "Login Successfully.."; frmdashboard dsb = new frmdashboard(); StudentReg std = new StudentReg(); this.Visible = false; dsb.lblusr.Text = "Admin"; //std.lbluser12.Text = "Admin"; this.Visible = false; dsb.ShowDialog(); } else { lblcolor.Text = "Checking Credential..."; // lblcolor.ForeColor = System.Drawing.Color.Red; } }