C # simple calculator for WinForm developed in language,

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.