private void btnLogOff_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Ben je zeker dat je wilt afmelden?", "Afmelden", MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.OK) { Form Login = new frmLogin(); Login.Show(); Form Home = new frmTask(); this.Close(); } }
private void btnLogin_Click(object sender, EventArgs e) { string strInputLogin, strInputPassword, strUserLogin, strUserPassWord; strInputLogin = txtUserName.Text; strInputPassword = txtPassWord.Text; strUserLogin = "******"; strUserPassWord = "******"; if (strInputLogin == "tom.verpooten") { if (strInputPassword == "vt011009.") { Form Task = new frmTask(); Task.Show(); Form Login = new frmLogin(); this.Hide(); } else { DialogResult dialogResult = MessageBox.Show("Je gebruikersnaam of wachtwoord zijn incorrect, probeer deze opnieuw.", "Input fout", MessageBoxButtons.OK, MessageBoxIcon.Error); if (dialogResult == DialogResult.OK) { txtUserName.Text = string.Empty; txtPassWord.Text = string.Empty; } } } else { DialogResult dialogResult = MessageBox.Show("Je gebruikersnaam of wachtwoord zijn incorrect, probeer deze opnieuw.", "Input fout", MessageBoxButtons.OK, MessageBoxIcon.Error); if (dialogResult == DialogResult.OK) { txtUserName.Text = string.Empty; txtPassWord.Text = string.Empty; } } }