Beruflich Dokumente
Kultur Dokumente
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 Calculator
{
public partial class Form1 : Form
{
private String calculatedNumber; // Stores numbers in string form
private Boolean dot = false; // Flag: to control when a dot can be placed
in a number
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.KeyPreview = true;
LblDisplay.Focus();
}
LblDisplay.Text = calculatedNumber;
}
case "=":
calculatedNumber = (LblDisplay.Text = Double.Parse(calculatedNumber)).ToString();
break; //equals button
}