急求,C#Windows窗体做记事本的代码,谢啦
1个回答
展开全部
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 calc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 + f2;
txtResult.Text = Convert.ToString(f);
}
private void button2_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 - f2;
txtResult.Text = Convert.ToString(f);
}
private void button3_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 * f2;
txtResult.Text = Convert.ToString(f);
}
private void button4_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 / f2;
txtResult.Text = Convert.ToString(f);
}
}
}
这是一个计算器的,你自己改改咯。这些是要自己到工具箱内拉一些控件才好写。。
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace calc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 + f2;
txtResult.Text = Convert.ToString(f);
}
private void button2_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 - f2;
txtResult.Text = Convert.ToString(f);
}
private void button3_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 * f2;
txtResult.Text = Convert.ToString(f);
}
private void button4_Click(object sender, EventArgs e)
{
float f, f1, f2;
f1 = Convert.ToSingle(txtVall1.Text);
f2 = Convert.ToSingle(txtVall2.Text);
f = f1 / f2;
txtResult.Text = Convert.ToString(f);
}
}
}
这是一个计算器的,你自己改改咯。这些是要自己到工具箱内拉一些控件才好写。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询