Lab 5
Lab 5
Part 4
Demo Project:
• Complex Calculator
Bhushan Mulmule
[email protected]
www.dotnetvideotutorial.com
www.dotnetvideotutorial.com
Demo Project 1: Complex Calculator
Form: Label:
Name: frmCalculator Name: lblDisplay
Text: Calculator AutoSize: False
BackColor: White
BorderStyle: FixedSingle
Text: Blank
TextAlign: MiddleRight
2 Group Boxes:
Text: Blank
18 Buttons:
Text: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,
., C, +, -, *, /, =, OFF
Instructions:
• When clicked on any number button that number should get displayed on label
lblDisplay.
• As all numeric buttons have same functionality we will add single handler
Digit_Click for click event of all numeric buttons
www.dotnetvideotutorial.com
• As all operator buttons have same functionality we will add single handler
Operator_Click for click event of all operator buttons
…..
}
Events Button
All number
buttons are
selected
Click Event
www.dotnetvideotutorial.com
4. In Digits_Click() handler write following code
www.dotnetvideotutorial.com
result = no1 / no2;
break;
}
lblDisplay.Text = result.ToString();
flg = true;
}
8. Clear button
9. OFF button
www.dotnetvideotutorial.com