private void BtnConfirm_Click(object sender, EventArgs e) { errorProvider1.SetError(BtnConfirm, ""); if (loginMap.ContainsValue(textBox1.Text)) { foreach (KeyValuePair <string, string> keyValue in loginMap) { if (keyValue.Value.Equals(textBox1.Text)) { loginMap.Remove(keyValue.Key); loginMap.Add(textBox2.Text, keyValue.Value); break; } } startForm.Show(); this.Close(); } else { errorProvider1.SetError(BtnConfirm, "Incorrect login, try again!"); } }
private void BtnBack_Click(object sender, EventArgs e) { startForm.Show(); this.Close(); }