C # Basic Video tutorial 4.1 How to write a simple calculator

Source: Internet
Author: User

To learn the basic form controls (Button,textbox,label, and their important properties), each control is named to conform to the specification (for example, the generic text box renames the txtXXXXX, and the button renames the btnXXXXX )

?

To prevent errors, the text box can be set to read-only (after you select the textbox, change the ReadOnly property to True)

?

In order to improve the user experience, the runtime is displayed in the center of the screen (StartPosition is set to Centerscreen after selecting the entire form)

?

Each control is essentially just a bunch of code (you drag and drop a control onto a form, In fact, in the form Form.Designer.cs add some properties and events, such as the definition of the button's font, location, size is a property, define this button click to define its event, the corresponding this.btn0_ Click is the method of execution (when the button has a click event, the corresponding method is executed)

?

Buttons In addition to the common size, font, location of the properties, there will be some other properties, such as whether it is available (Enabled property), you click on a specific control to view the properties, you can find all of his properties, you can also directly set

?

button In addition to the common click event, the button will have other such as double-click, Button Press, button to release the event, if you want to use a new event, only need to switch to the event button, double-click in the blank area to automatically add the corresponding event and method

?

Note that the control binding event after VS2013 is checked, and if you delete the corresponding method of an event, delete the corresponding event (do not click Ignore and Continue), even if the previous version of Visual Studio is deleted, of course, if you remove the button control, Then everything in the Designer.cs file will erase all the attributes.

?

We can do another test, create an empty program, Form1.cs and Form1.Designer.cs have just done to copy and replace the original default file, and then change the Program.cs, the new program can be used, from this example can be seen, Designer.cs file is a description of the form control (similar to WPF is XAML to Description, QT is qml to describe), and the Form1.cs file is the code that implements the function (so everyone should at least figure out a complete C # The program contains two parts: The design part of the Designer.cs file and the execution part of the Form1.cs file, of course, here we put the implementation of all in the Form1.cs inside, immediately will not be said in the Form1.cs inside the situation)

?

?

For more instructional videos and downloads, please pay attention to the following information:

My Youku Space:

Http://i.youku.com/acetaohai123

?

My online forum:

http://csrobot.gz01.bdysite.com/

?

Problem Exchange:

qq:910358960

Email:[email protected]

?

?

?

C # Basic Video tutorial 4.1 How to write a simple calculator

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.