public frmRecharge(frmMain pf, frmCardUser pfu)
 {
     InitializeComponent();
     this.icdev = pf.icdev;
     this.pf    = pf;
     this.pfu   = pfu;
 }
        private void btnOpenIC_Click(object sender, EventArgs e)
        {
            if (!connectIC)
            {
                MessageBox.Show("请等待串口打开成功!");
                return;
            }

            f = new frmCardUser(this);
            f.ShowDialog();

            /*
             * if (f == null) //如果子窗体为空则创造实例 并显示
             * {
             *  f = new frmCardUser(this);
             *  f.ShowDialog();
             * }
             * else
             * {
             *  if (f.IsDisposed)//若子窗体关闭 则打开新子窗体 并显示
             *  {
             *      f = new frmCardUser(this);
             *      f.ShowDialog();
             *  }
             *  else
             *  {
             *      f.Activate(); //使子窗体获得焦点
             *  }
             * }
             * */
        }