示例#1
0
 //“继续”按钮
 private void btnNext_Click(object sender, EventArgs e)
 {
     //判断姓名是否为空
     if (txtName.Text.Trim().Length > 0)
     {
         //保存英雄信息(请编码实现)
         GameManager.GameInfo.Hero.Name = txtName.Text;
         GameManager.GameInfo.Hero.Gender = rdoMale.Checked ? Gender.Male:Gender.Female;
         //切换下一界面
         CreateHeroForm chForm = new CreateHeroForm();
         chForm.StartPosition = FormStartPosition.Manual;    //设置窗体第一次出现的位置
         chForm.Location = new Point(this.Location.X, this.Location.Y);  //设置窗体出现的坐标
         chForm.Show();      //显示下一窗体
         this.pnlCreateHero.Visible = false;     //隐藏创建英雄面板
         this.Hide();        //隐藏本窗体
     }
     else
     {
         MessageBox.Show("请输入姓名!", "系统提示",
             MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
示例#2
0
 //“继续”按钮
 private void btnNext_Click(object sender, EventArgs e)
 {
     //判断姓名是否为空
     if (txtName.Text.Trim().Length > 0)
     {
         //保存英雄信息(请编码实现)
         GameManager.GameInfo.Hero.Name   = txtName.Text;
         GameManager.GameInfo.Hero.Gender = rdoMale.Checked ? Gender.Male:Gender.Female;
         //切换下一界面
         CreateHeroForm chForm = new CreateHeroForm();
         chForm.StartPosition = FormStartPosition.Manual;                    //设置窗体第一次出现的位置
         chForm.Location      = new Point(this.Location.X, this.Location.Y); //设置窗体出现的坐标
         chForm.Show();                                                      //显示下一窗体
         this.pnlCreateHero.Visible = false;                                 //隐藏创建英雄面板
         this.Hide();                                                        //隐藏本窗体
     }
     else
     {
         MessageBox.Show("请输入姓名!", "系统提示",
                         MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }