程式設計工藝大師
DataBase2
2015年11月27日 星期五
2015年11月19日 星期四
2015年11月5日 星期四
20151106_計算機
程式設計工藝大師
計算機
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
label2.Text = Convert.ToString(double.Parse(textBox1.Text) + double.Parse(textBox2.Text));
}
private void button2_Click(object sender, EventArgs e)
{
label2.Text = Convert.ToString(double.Parse(textBox1.Text) - double.Parse(textBox2.Text));
}
private void button3_Click(object sender, EventArgs e)
{
label2.Text = Convert.ToString(double.Parse(textBox1.Text) * double.Parse(textBox2.Text));
}
private void button4_Click(object sender, EventArgs e)
{
if (double.Parse(textBox2.Text) == 0)
{
label2.Text = " ";
MessageBox.Show("cant 0");
return;
}
label2.Text = Convert.ToString(double.Parse(textBox1.Text) / double.Parse(textBox2.Text));
}
}
}
計算機
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
label2.Text = Convert.ToString(double.Parse(textBox1.Text) + double.Parse(textBox2.Text));
}
private void button2_Click(object sender, EventArgs e)
{
label2.Text = Convert.ToString(double.Parse(textBox1.Text) - double.Parse(textBox2.Text));
}
private void button3_Click(object sender, EventArgs e)
{
label2.Text = Convert.ToString(double.Parse(textBox1.Text) * double.Parse(textBox2.Text));
}
private void button4_Click(object sender, EventArgs e)
{
if (double.Parse(textBox2.Text) == 0)
{
label2.Text = " ";
MessageBox.Show("cant 0");
return;
}
label2.Text = Convert.ToString(double.Parse(textBox1.Text) / double.Parse(textBox2.Text));
}
}
}
訂閱:
文章 (Atom)