private void btnATM(object sender, EventArgs e) { string securityCode = "RON"; string customerPIN = txtPIN.Text.ToUpper(); if (securityCode == customerPIN) { MessageBox.Show("Welcome to Ron's ATM!", "Ron's ATM", MessageBoxButtons.OK, MessageBoxIcon.Information); lbAnswer.Items.Add("Welcome " + securityCode); } else { Count++; if (Count == 3) { MessageBox.Show("You are a crook. We are keeping your card!", "Ron's ATM", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } else { MessageBox.Show("That is an incorrect PIN", "Ron's ATM", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPIN.Text = string.Empty; txtPIN.Focus(); } } }