Hey dosto yeh post me apko bataya gaya hai ke app kis tarha se ek Basic or simple calculator Create kar sakte hain wo bhi bohat hi asani ke sath calculator create karne ke liye apke pass Microsoft Visual Studio 2010 Lazmi Intall hona chaiyeh Kyon ke hum Microsoft Visual studio ke ander hi simple calculator create karege. Simple calculator ka matlab hai ke hum bus is me Arithematic operator use karenge Example simple basic Calculator: Addition, Subtraction,Multiplication and Divisions Simple basic calculator me bus hum yeh operations kar saktey hain. or dosto yeh calculator create karn bohat hi asan hai visual studio simple calculator source code ke sath apko me dunga agar ap is ka soucre code chatey hai to is post ke last me apko visual studio simple calculator ka source code mil jaye ga or dosto agar yeh post apko acha laga to Share karenge or mere youtube channel ko bhi Subscirbe karen
https://www.youtube.com/babarahsan
#VisualStudioSimpleCalculatorSourceCode
Visual Studio Simple Calculator Source 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 Calculator
{
public partial class Form1 : Form
{
Double resultvalue = 0;
String operationperform = "";
bool isoperationperfrm = false;
public Form1()
{
InitializeComponent();
}
private void button_click(object sender, EventArgs e)
{
if ((resulttextBox1.Text == "0" )|| (isoperationperfrm ))
resulttextBox1.Clear();
isoperationperfrm = false;
Button button=(Button)sender;
if (resulttextBox1.Text == ".")
{
if(resulttextBox1.Text.Contains("."))
resulttextBox1.Text = resulttextBox1.Text + button.Text;
}
else
resulttextBox1.Text = resulttextBox1.Text + button.Text;
}
private void operator_click(object sender, EventArgs e)
{
Button button = (Button)sender;
operationperform = button.Text;
resultvalue = Double.Parse(resulttextBox1.Text);
previewlabel1.Text = resultvalue + " " + operationperform;
isoperationperfrm = true;
}
private void button16_Click(object sender, EventArgs e)
{
resulttextBox1.Text = "0";
}
private void button17_Click(object sender, EventArgs e)
{
resulttextBox1.Text = "0";
resultvalue = 0;
}
private void button18_Click(object sender, EventArgs e)
{
switch(operationperform)
{
case "+":
resulttextBox1.Text=(resultvalue + Double.Parse(resulttextBox1.Text)).ToString();
break;
case "-":
resulttextBox1.Text = (resultvalue - Double.Parse(resulttextBox1.Text)).ToString();
break;
case "*":
resulttextBox1.Text = (resultvalue * Double.Parse(resulttextBox1.Text)).ToString();
break;
case "/":
resulttextBox1.Text = (resultvalue / Double.Parse(resulttextBox1.Text)).ToString();
break;
default:
break;
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
0 komentar:
Post a Comment