怎么做一个简单的计算器,要求:可以做+,-,*,/,1/x,sqrt

来源:百度知道 编辑:UC知道 时间:2024/09/26 04:26:56
我已经做了一个了,但是存在一个错误不会改,我就这点分数,希望帮帮忙啊,对我很重要,谢谢了
错误 1 类型“h.Form1”的声明上缺少 partial 修饰符;存在此类型的其他分部声明 D:\Documents and Settings\Administrator.ADM-76DC1F043A0\My Documents\Visual Studio 2005\Projects\h\h\Form1.cs 14 15 h

发你了

FFF

我自己写了一个程序可以运行的,下面写上我自己写的代码.实现了你的要求如下
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
string operation = null;
string save = null;
private void Form3_Load(object sender, EventArgs e)
{

}

private void btn_Equal_Click(object sender, EventArgs e)
{
switch(operation)
{
case "+":
{
textBox1.Text = Convert.ToString(Convert.ToSingle(save) + Convert.ToSingle(textBox1.Text));
break