Từ:
01:05 27/07/2013
Bài:
16
Cảm ơn:
12
Thích:
1
Mình cũng làm cái máy tính,
đây là ở phần code:
using System;using System.Collections.Generic;
using System.ComponentModel;
using System.Data;using System.Drawing;
using System.Linq;using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplicationdemo{
public partial class Form1 : Form
{ public Form1()
{ InitializeComponent();
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int a = int.Parse(txta.Text);
int b = int.Parse(txtb.Text);
txtkq.Text = (a + b).ToString();
}
private void button2_Click(object sender, EventArgs e)
{
int a = int.Parse(txta.Text);
int b = int.Parse(txtb.Text);
txtkq.Text = (a - b).ToString();
}
private void button3_Click(object sender, EventArgs e)
{
txta.Text = ""; txtb.Text = ""; txtkq.Text = "";
}
private void txta_TextChanged(object sender, EventArgs e)
{
}
}}
còn phần giao diện chính gồm có: 3 button tương ứng với "+ , - , xoá ";
3 label tương ứng với : " nhập a, nhập b, kết quả"
và cuối cùng là 3TextBox:để nhập a,b và hiện kết quả