using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace CDSAE3_Lian_Lian_Kan.Forms { public partial class FinishedMessageBox : Form { public FinishedMessageBox() { InitializeComponent(); } int score = 0; int costTime = 0; public FinishedMessageBox(int score,int costTime) { InitializeComponent(); Location = new Point(Etcs.form!.Left + Etcs.form.Width - Width / 2, Etcs.form.Top + Etcs.form.Height + Height / 2); this.score = score; this.costTime = costTime; scoreLabel.Text = "分数:" + score.ToString(); scoreLabel.Location = new Point((649 - scoreLabel.Size.Width) / 2, scoreLabel.Location.Y); } private void nameTextBox_Enter(object sender, EventArgs e) { nameTextBox.Font = new Font("Microsoft YaHei UI", 15F); nameTextBox.ForeColor = Color.FromArgb(0,0,0); nameTextBox.Text = ""; } private void 确定_Click(object sender, EventArgs e) { Etcs.charts.AddRecord(new Etcs.RecordInfo { Name = nameTextBox.Text==""?"Anonymous": nameTextBox.Text ,Score = score,Time = DateTime.Now,CostTime = costTime,Difficulty = Etcs.current_difficulty.ToString()}); Close(); } } }