1. WinForm Create a solution

Source: Internet
Author: User

WinForm's development tools can use the VS2005---VS2013, the version is constantly upgrading, and the function of VS is becoming more and more powerful. This series of articles uses VS2012 (later full-name vs) demo.

Forms are the basis for WinForm development, and you need to master the creation of forms, properties, calls, and form passing values, and so on.

1. Creation of WinForm Solution

Open vs File, new project, from top to bottom in the diagram.

(1) You can choose the. NET framework Framework, vs2012 default is NF4, the point to note here is that If you are using a program developed in NF2.0 or above, you will need to hit the. NET Framework, the so-called dependencies, when installing in the Windows operating system, and the dependencies are described later when the files are packaged.

(2) Select the Windows Forms application, stating that we are creating the WinForm program, vs the default is the ASP.

(3) Give the solution a name and choose a storage location. Generally we will choose to create a directory for the solution, if the multi-person joint development, need to check source control, source control is generally used in visual SourceSafe version 2005 and above.

Then click OK and we can see that VS has created an initial WinForm program for us, and clicking on the start or F5 in VS will run directly. As you can see, the right side is our solution directory.

A brief introduction to the layout of VS, I prefer the left-middle-right this way of display, accustomed to it. The left side shows the toolbar/Server Explorer/data source, and so on, the middle is code editing, the bottom is the running condition view, the right side is the project directory/property. If you accidentally turn off a panel, you can select it in view. Then press and hold the panel drag to move to the location you want to place, it is fun, you can try.

2. Setup of System default form

As a software, there must be an entrance bar, that is, the system to run the first interface, you can find the Program.cs file from the directory of the solution, open to see the following code

Using system;using system.collections.generic;using system.linq;using system.windows.forms;namespace WindowsForms{    Static Class    program {//<summary>///        Main entry point for application. //        </summary>        [STAThread]        static void Main ()        {            application.enablevisualstyles ();            Application.setcompatibletextrenderingdefault (false);            Application.Run (New Form1 ());}}}    

Oh, see the bar application. Run (New Form1 ()); The initial window of the program is FORM1 chatter.

1. WinForm Create a solution

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.