• 大小: 48KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: 其他
  • 标签: c#  

资源简介

一个有趣的竖式计算器 实现随机出数 并且以竖式出现 只需计算所得数 是一个比较好的给孩子锻炼算数的小软件 直接运行即可 用vs2008以上版本

资源截图

代码片段和文件信息

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

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        int a b c;
        int N M;
        Boolean flag=false;
        private void SetValue()
        {
            Random rand = new Random();
            a = rand.Next(99 1000);
            b = rand.Next(99 1000);
            c = a + b;
            label2.Text = a.ToString();
            label4.Text = b.ToString();
            label8.Text = “你好棒,做对了“ + N.ToString() + “道题“;
            label9.Text = “你好棒,做对了“ + M.ToString() + “道题“;
        }
        private void Form1_Load(object sender EventArgs e)
        {
            this.SetValue();

        }

        private void button1_Click_1(object sender EventArgs e)
        {
            flag = true;
            if (textBox1.Text == ““)
                MessageBox.Show(“你还没有完成本道题目哦!“);

            else if (c == Convert.ToInt32(textBox1.Text))
            {
                label6.Text = “好棒请点击下一题“;
                M++;
            }
            else
            {
                label6.Text = “你的答案是:“ + textBox1.Text;
                label7.Text = “正确答案是:“ + c.ToString();

            }
            N++;

        }

        private void button2_Click_1(object sender EventArgs e)
        {
            if (textBox1.Text == ““||flag==false)
            {
                MessageBox.Show(“你还没有完成本道题目哦!“);
            }
            else
            {
                this.SetValue();
                label6.Text = null;
                label7.Text = null;
                textBox1.Text = null;
                flag = false;

            }
        }

        private void textBox1_TextChanged(object sender EventArgs e)
        {

        }

        private void label1_Click(object sender EventArgs e)
        {

        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-03-13 14:18  竖式计算器\
     目录           0  2014-03-13 14:22  竖式计算器\WindowsFormsApplication3\
     目录           0  2014-03-09 19:10  竖式计算器\WindowsFormsApplication3\bin\
     目录           0  2014-03-10 16:49  竖式计算器\WindowsFormsApplication3\bin\Debug\
     文件       11776  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe
     文件       32256  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.pdb
     文件       11608  2014-04-18 14:23  竖式计算器\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe
     文件         490  2010-03-17 22:39  竖式计算器\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.manifest
     目录           0  2014-03-09 19:10  竖式计算器\WindowsFormsApplication3\bin\Release\
     文件        2260  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\Form1.cs
     文件        8674  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\Form1.Designer.cs
     文件        5814  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\Form1.resx
     目录           0  2014-03-09 17:05  竖式计算器\WindowsFormsApplication3\obj\
     目录           0  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\obj\Debug\
     文件        1229  2014-03-10 16:49  竖式计算器\WindowsFormsApplication3\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6219  2014-04-18 14:23  竖式计算器\WindowsFormsApplication3\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2014-03-09 19:10  竖式计算器\WindowsFormsApplication3\obj\Debug\TempPE\
     文件        4608  2014-03-09 19:10  竖式计算器\WindowsFormsApplication3\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
     文件        1854  2014-04-18 14:23  竖式计算器\WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.csproj.FileListAbsolute.txt
     文件         847  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.csproj.GenerateResource.Cache
     文件       11776  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.exe
     文件         180  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.Form1.resources
     文件       32256  2014-03-13 14:21  竖式计算器\WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.pdb
     文件         180  2014-03-09 19:11  竖式计算器\WindowsFormsApplication3\obj\Debug\WindowsFormsApplication3.Properties.Resources.resources
     文件         505  2014-03-05 21:40  竖式计算器\WindowsFormsApplication3\Program.cs
     目录           0  2014-03-09 17:05  竖式计算器\WindowsFormsApplication3\Properties\
     文件        1398  2014-03-05 21:40  竖式计算器\WindowsFormsApplication3\Properties\AssemblyInfo.cs
     文件        2888  2014-03-09 19:10  竖式计算器\WindowsFormsApplication3\Properties\Resources.Designer.cs
     文件        5612  2014-03-05 21:40  竖式计算器\WindowsFormsApplication3\Properties\Resources.resx
     文件        1124  2014-03-09 19:10  竖式计算器\WindowsFormsApplication3\Properties\Settings.Designer.cs
     文件         249  2014-03-05 21:40  竖式计算器\WindowsFormsApplication3\Properties\Settings.settings
............此处省略2个文件信息

评论

共有 条评论