C # simple calculator for WinForm developed in language,
The last C # lab class required the development of a Windows-based WinForm calculator to implement basic operations such as addition, subtraction, multiplication, division, and so on. There are many problems with the reference documentation, and the floating point number cannot be calculated (I really don't know what is the division function at this time). The interface layout is very ugly (1 ). After improvement, the following improvement results are obtained: (2) used as an experiment report. This is sufficient and the function is basically complete. I will share some of the running results and project source code here, hoping to help beginners of WinForm programming.
Figure 1. Lab requirements Calculator
Figure 2. My Calculator
The added functions are as follows:
1. floating point number calculation, the calculation result range is ± 5. 0 × 10 ^ − 324 to ± 1. 7 × 10 ^ 308;
2. display the formula to the page. The +,-, *,/, and other symbols can be displayed on the page;
3. You can enter floating point numbers (decimal places), such as 3.14;
4. Supports keyboard shortcuts. The page is designed exactly like a keypad to facilitate quick data input;
5. The formula and result clearing (CE key) are supported to clear the previous calculation results and the current formula.
Although it is much easier to use than the calculator required in the original lab report, it is not perfect.
Improvements:
1. Continuous computation is not allowed, that is, the previous computation result cannot be used as the input for the next computation;
2. The operator input is not checked. If multiple repeated plus signs 2 + + 6 are entered, the calculation result may be incorrect;
3. complex operations such as square brackets or square operators are not supported;
Upload source code first: Click to download the project source code and experiment instructions (password: cldr ).
Or directly access the following link:
Project source code link: http://pan.baidu.com/s/1ntOh4F3
Lab instructions link: http://pan.baidu.com/s/1nt9ow8x password: cldr
Original blog post. You must include the original article address when reprinting. Thank you.