• 大小: 38KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-01
  • 语言: C#
  • 标签:

资源简介

本计算器 实现了等号连加 运算符连加 混合运算..............

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace jisuanqi
{


    public partial class Form1 : Form
    {
        Button but;
       private string num1;
       private  string num2;
       private string str;
   
        private string st;
      private  bool c;
        private bool d;
        
        public Form1()
        {
            InitializeComponent();
        }
         private void Form1_Load(object sender EventArgs e)
        {
            init();
        }
        #region 初始化
        protected void init()
        {
            num1 = ““;
            num2 = ““; 
            str = ““;
            st = ““;
           
            d = true;
            c = true;
            
            textBox1.Text = “0“;
        }
        #endregion
        #region 数字事件
        private void button6_Click(object sender EventArgs e)
        {
            but = (Button)sender;
            shuzi();
        }
        private void shuzi()
        { 
       
           if (c)
           {
                     if (but.Text==“.“&&textBox1.Text == “0“)
                        st = “0.“;
                     if (st == “0“)
                         st = but.Text;
                     else
                     {
                         
                         if (but.Text != “.“ || st.IndexOf(“.“) == -1)
                         {
                             st += but.Text;
                       }
                     }
                    num1 = st;
                 }
                 else
                 {
                    
                        
                     if (but.Text == “.“ && textBox1.Text == “0“||but.Text == “.“ && st== ““)
                         st = “0.“;
                     if (st == “0“)
                         st = but.Text;
                     else
                     {
                         if (but.Text != “.“ || st.IndexOf(“.“) ==-1)
                         {
                             st += but.Text;
                            
                         }
                     }
                  num2 = st;
                 }
                 textBox1.Text = st;
             }
        #endregion
        #region 运算符事件
             protected void button11_Click(object sender EventArgs e)
        {
          
              Button bu = (Button)sender;
              
              if (d)
              {
                  d = false;
                  str = bu.Text;
              
              }
              else
              {
                  num1 = yunsuanfu(num1 num2 str);
                  textBox1.Text = num1;
                  str = bu.Text;
               
             }
            st = ““;
            c = false; 
         } 
     
        private string yunsuanfu(st

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        926  2007-12-05 11:45  jianqiang\jisuanqi.sln

    ..A..H.     15872  2007-12-05 11:45  jianqiang\jisuanqi.suo

     文件       3072  2006-11-05 11:44  jianqiang\jisuanqi\jisuanqi.suo

     文件       5814  2006-11-05 10:34  jianqiang\jisuanqi\Form1.resx

     文件       3431  2007-12-05 10:25  jianqiang\jisuanqi\jisuanqi.csproj

     文件      12754  2006-11-05 10:34  jianqiang\jisuanqi\Form1.Designer.cs

     文件       4155  2006-11-05 10:34  jianqiang\jisuanqi\Form1.cs

     文件        467  2007-11-23 10:18  jianqiang\jisuanqi\Program.cs

     文件        275  2006-11-05 11:39  jianqiang\jisuanqi\obj\jisuanqi.csproj.FileList.txt

     文件        180  2008-12-16 20:55  jianqiang\jisuanqi\obj\Debug\jisuanqi.Form1.resources

     文件        180  2007-11-23 10:31  jianqiang\jisuanqi\obj\Debug\jisuanqi.Properties.Resources.resources

     文件      24576  2006-11-05 10:37  jianqiang\jisuanqi\obj\Debug\jisuanqi.exe

     文件         90  2008-11-23 10:02  jianqiang\jisuanqi\obj\Debug\jisuanqi.csproj.FileListAbsolute.txt

     文件       4608  2008-11-23 10:02  jianqiang\jisuanqi\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件      34304  2006-11-05 10:37  jianqiang\jisuanqi\obj\Debug\jisuanqi.pdb

     文件        842  2006-11-05 10:34  jianqiang\jisuanqi\obj\Debug\jisuanqi.csproj.GenerateResource.Cache

     文件       5632  2005-11-11 22:25  jianqiang\jisuanqi\bin\Debug\jisuanqi.vshost.exe

     文件      24576  2006-11-05 10:37  jianqiang\jisuanqi\bin\Debug\jisuanqi.exe

     文件      34304  2006-11-05 10:37  jianqiang\jisuanqi\bin\Debug\jisuanqi.pdb

     文件       5612  2007-11-23 10:18  jianqiang\jisuanqi\Properties\Resources.resx

     文件        249  2007-11-23 10:18  jianqiang\jisuanqi\Properties\Settings.settings

     文件       1164  2007-11-23 10:18  jianqiang\jisuanqi\Properties\AssemblyInfo.cs

     文件       2840  2008-11-23 10:02  jianqiang\jisuanqi\Properties\Resources.Designer.cs

     文件       1106  2008-11-23 10:02  jianqiang\jisuanqi\Properties\Settings.Designer.cs

     目录          0  2008-12-24 19:21  jianqiang\jisuanqi\obj\Debug\TempPE

     目录          0  2008-12-24 19:21  jianqiang\jisuanqi\obj\Debug

     目录          0  2008-12-24 19:21  jianqiang\jisuanqi\bin\Debug

     目录          0  2008-12-24 19:21  jianqiang\jisuanqi\obj

     目录          0  2008-12-24 19:21  jianqiang\jisuanqi\bin

     目录          0  2008-12-24 19:21  jianqiang\jisuanqi\Properties

............此处省略5个文件信息

评论

共有 条评论

相关资源