11-01-2010, 07:04 PM
|
|
|
|
تاريخ التسجيل: Oct 2010
العمر: 35
المشاركات: 268
|
|
وعليكم السلام ورحمة الله
جزااكم الله خيراا...عملت الكود وربناا يستر!
كود PHP:
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 Collection
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
double num1, num2;
num1 = double.Parse(textBox2.Text);
num2 = double.Parse(textBox3.Text);
// MessageBox.Show((num1 + num2).ToString());
textBox4.Text = (num1 + num2).ToString();
}
catch
{
MessageBox.Show("يرجى التأكد من القيم المدخلة");
textBox2.Text = "0";
textBox3.Text = "0";
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
double num1, num2;
num1 = double.Parse(textBox2.Text);
num2 = double.Parse(textBox3.Text);
// MessageBox.Show((num1 - num2).ToString());
textBox4.Text = (num1 - num2).ToString();
}
catch
{
MessageBox.Show("يرجى التأكد من القيم المدخلة");
textBox2.Text = "0";
textBox3.Text = "0";
}
}
private void button3_Click(object sender, EventArgs e)
{
try
{
double num1, num2;
num1 = double.Parse(textBox2.Text);
num2 = double.Parse(textBox3.Text);
// MessageBox.Show((num1 * num2).ToString());
textBox4.Text = (num1 * num2).ToString();
}
catch
{
MessageBox.Show("يرجى التأكد من القيم المدخلة");
textBox2.Text = "0";
textBox3.Text = "0";
}
}
private void button4_Click(object sender, EventArgs e)
{
try
{
double num1, num2;
num1 = double.Parse(textBox2.Text);
num2 = double.Parse(textBox3.Text);
// MessageBox.Show((num1 / num2).ToString());
textBox4.Text = (num1 / num2).ToString();
}
catch
{
MessageBox.Show("يرجى التأكد من القيم المدخلة");
textBox2.Text = "0";
textBox3.Text = "0";
}
}
private void button5_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
|