コード例 #1
0
        public Form1(play pl)
        {
            InitializeComponent();
            txtdiemNC1.Enabled = false;
            txtNC1.Text        = pl.GetNC1;
            txtNC2.Text        = pl.GetNC2;
            txtdiemNC1.Enabled = false;
            txtDiemHoa.Enabled = false;
            txtdiemNC2.Enabled = false;
            txtNC1.Enabled     = false;
            txtNC2.Enabled     = false;
            Highscore();


            // End();
        }
コード例 #2
0
 private void btnPlay_Click(object sender, EventArgs e)
 {
     //kiểm tra xem người chơi đã nhập tên hay chưa
     if (txtNC1.Text == "")
     {
         MessageBox.Show("Chưa nhập tên người chơi 1");
     }
     else if (txtNC2.Text == "")
     {
         MessageBox.Show("Chưa nhập tên người chơi 2");
     }
     else
     {
         play pl = new play();
         pl.GetNC1 = txtNC1.Text;
         pl.GetNC2 = txtNC2.Text;
         Form1 frm = new Form1(pl);
         frm.Show();
         this.Hide();
     }
     //string NC1 = txtNC1.Text;
     // string NC2 = txtNC2.Text;
 }