Develop the first Windows application in C # (one of the C # Learning notes)

Source: Internet
Author: User
Tags visual studio
Developing the first Windows application in C #
One of the C # learning notes
Author: Zhejiang Wenling Telecommunication Bureau Wang Jun
Excerpt from: http://www.vckbase.com/
Reader level: primary, Intermediate
C # is a modern programming language, contained in Visual Studio. Net 7.0. It simplifies C + + complexity and maintains flexibility, which is easy for people who have learned C + +. Visual Studio. NET 7.0 Beta1 has been published while writing this article, which is a simple development attempt for this release.
Sample code Download 18K
First, create the project
As shown in the picture, select New->project in the File menu of the integrated development environment to open the New Project dialog box

We chose the project type for Visual C # Projects, select Windows application in the template,
Enter the project name at name: Hellowindows, enter the saved path in location.

After the confirmation, the system automatically generates the program framework for you.
Now let's simply get acquainted with the development environment.

This is our development environment!
Area A is our toolbox, including support for databases, components, form controls, and so on, and we can all choose to add to the form, and if you can't find toolbox, select Toolbox in the menu view to open it.
Area B is our design workspace (including the design of the interface, code), which shows the main window of the application we just created: Form1.
C area equivalent to our Workspace:solution Explorer in VC6 can be seen as the previous Fileview,resourceview and classview everyone must be very familiar with, see Solution Explorer in the Are you Form1.cs? This is the Form1 corresponding C # file, double-click it to Form1 interface design, right click Form1.cs in the pop-up menu select View Code can see the corresponding codes.
Section D is a property window: Similar to the Properties window we have in the resource editor in VC6, but more powerful, you can modify its properties directly here, such as text, background color, etc. for components on the screen, such as buttons and list boxes.
Our next task is to create a dialog box and add a menu to open this dialog box.
Second, add a new form: about the dialog box
Select Menu Project->add Windows Form, select the category for local Project Items in the pop-up dialog box, select the template for Windows Form, and enter the filename in name: AboutDlg.cs, confirm. The new form appears in the workspace, and we change the text to "about" in the Properties dialog box in section D and choose BackColor to be light blue, and you can also try other properties.
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.