
sender is the object that fired the event. The typical signature of an event handler is void EventHandler(object sender, EventArgs e).

TxtResult.Text += ButtonThatWasPushed.Text Void digitButton_Click(object sender, EventArgs e)īutton ButtonThatWasPushed = (Button)sender

So the First step is When we press the numbers in the calculator, it need to be displayed in the text box. This will be the first number in the additionĢ.The first number you want to add will then appear in the text boxģ.Click the Plus button to tell the calculator you want to addĤ.The first number will disappear from the text box, ready for the second numberĥ.Click the number buttons again to add the second numberĦ.Click the equals button and the answer appears in the text box This section is for the programmers who are just starting with C#.This Calculator does addition, subtraction, multiplication and division.If u try to launch calculator by running calc from Run window.You will get an Idea, how a calculator works.Here i have tried to recreate Windows calculator with the help of c# Language.īefore we get to the code, let’s just go through how our calculator is going to work:ġ.Click the number buttons.
