示例#1
0
        private void Form5_Load(object sender, EventArgs e)
        {
            BO.ReadPlayers("player.txt", pl);
            int k = 0;
            int j = 0;

            while (j < pl.Count * 2)
            {
                Label lb = new Label();
                lb.Width    = 100;
                lb.Height   = 50;
                lb.AutoSize = false;
                if (j % 2 == 0)
                {
                    lb.Text = pl[k].Name;
                }
                else
                {
                    lb.TextAlign = ContentAlignment.TopRight;
                    lb.Text      = pl[k].Time.ToString() + " s";
                    k++;
                }
                fpn1.Controls.Add(lb);
                j++;
            }
        }
示例#2
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     continues = new int[10, 18];
     if (BO.DocMang("continutes.txt", continues) == 0)
     {
         btnConti.Enabled = false;
     }
 }
示例#3
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            BO.Delete("continutes.txt");
            this.Hide();
            sdk = new Sudoku();
            FormLevel f2 = new FormLevel(sdk);

            f2.ShowDialog();
            this.Show();
        }
示例#4
0
 private void Form3_FormClosing_1(object sender, FormClosingEventArgs e)
 {
     timer1.Stop();
     if (txt2.Text != 0.ToString())
     {
         pn1.Visible = false;
         DialogResult result = MessageBox.Show("Save Game ?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes)
         {
             //ghifile
             ctn();
             BO.Ghimang("continutes.txt", continues);
             Environment.Exit(1);
         }
     }
     else
     {
         FormInfo f4 = new FormInfo();
         f4.Location = new Point(this.Location.X + (this.Width - f4.Width), this.Location.Y + (this.Height - f4.Height));
         int time = int.Parse(lb1.Text) * 60 + int.Parse(lb3.Text);
         f4.Time = time;
         f4.ShowDialog();
     }
 }
示例#5
0
 private void btn_Click(object sender, EventArgs e)
 {
     BO.WriterPlayers("player.txt", txtname.Text, txttime.Text);
     MessageBox.Show("Lưu thành công", "Save");
     this.Close();
 }