private void frmScores_FormClosing(object sender, FormClosingEventArgs e) { if (btnAdd.Enabled) { HighScoreList.add(new HighScores(txtName.Text, curScore, coinsAdded, difficulty)); } GTools.saveHighScores(GTools.saveFile); }
private void btnAdd_Click(object sender, EventArgs e) { HighScoreList.add(new HighScores(txtName.Text, curScore, coinsAdded, difficulty)); txtName.Enabled = false; btnAdd.Enabled = false; dgvInit(); this.Close(); }