Ejemplo n.º 1
0
 /// <summary>
 /// 注册
 /// </summary>
 private void 注册ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RegisterForm regForm = new RegisterForm();
     regForm.ShowDialog(this);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 等于
        /// </summary>
        private void btnEqual_Click(object sender, EventArgs e)
        {
            //判断程序能否继续使用
            if (!Common.IsProgramPassValidate())
            {
                try
                {
                    RegisterForm regForm = new RegisterForm();
                    regForm.ShowDialog(this);
                    return;
                }
                catch
                {
                    return;
                }
            }

            try
            {
                if (this.语音ToolStripMenuItem1.Checked)
                {
                    //中止之前的计算结果发音
                    if (this.speechResultThread != null)
                    {
                        this.speechResultThread.Abort();
                        this.speechResultThread = null;
                    }
                }

                if (txtExp.Text.IndexOf("=") != -1)//存储变量
                {
                    memoryVars();
                }
                else//计算
                {
                    result = Calculate();//计算
                    ANS = result.GeneralResultToShow;//保存计算结果
                    txtResult.Text = ANS;//显示计算结果

                    //计算结果发音
                    if (this.语音ToolStripMenuItem1.Checked)
                    {
                        //起动线程发音
                        speechResultThread = new System.Threading.Thread(new System.Threading.ThreadStart(SpeechResult));
                        speechResultThread.Start();
                    }
                }
                txtExp.Focus();
                txtExp.SelectionStart = txtExp.Text.Length;
                isScientificShow = false;
                //记录表达式
                MemoryExpr_Cal();
            }
            catch (Exception ex)
            {
                //计算结果框中显示出错信息
                ShowException(ex);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 存储函数
 /// </summary>
 private void 存储函数ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //判断程序能否继续使用
     if (Common.IsProgramPassValidate())
     {
         if (addFun == null || addFun.IsDisposed)
         {
             addFun = new AddFun();
             addFun.Show();
         }
         else
         {
             addFun.Focus();
         }
     }
     else
     {
         try
         {
             RegisterForm regForm = new RegisterForm();
             regForm.ShowDialog(this);
             return;
         }
         catch
         {
             return;
         }
     }
 }