Please See In Bellow :
If you want to adding two values then you can see in bellow .You can also perform subtraction, multiplication and division. you will change the main logic , here the main logic is result = firstValue + secondvalue .Then you only changed the operator. Then you can perform .By Syed Sohel .
The Graphical View :
The Code :
The Graphical View :
The Code :
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 Show_String
{
public partial class Adding_Values
: Form
{
public Adding_Values()
{
InitializeComponent();
}
private void
addButton_Click(object sender, EventArgs e)
{
double firstValue, secondvalue, result;
firstValue = Double.Parse(firstValueTextBox.Text);
// here we can also use anotheb formate like as:
Convert.ToDouble(firstValueTextBox.Text);
secondvalue = Double.Parse(secondValueTextBox.Text);
result = firstValue + secondvalue;
resultValueTextBox.Text = result.ToString();
}
}
}