Today, I started to play with the handwritten form code. I also want to train the learning code ......
Windows formsapplication automatically creates some files when it is created. The next creation of WinFormStudy is used as an example. Let's take a look at the code in each file:
1. Program. cs
1 UsingSystem;
2 UsingSystem. Collections. Generic;
3 UsingSystem. Linq;
4 UsingSystem. Windows. Forms;
5
6 NamespaceWinFormStudy
7 {
8 Static ClassProgram
9 {
10 /// <Summary>
11 ///The main entry point of the application.
12 /// </Summary>
13 [STAThread]
14 Static VoidMain ()
15 {
16 ///Application can output 45 entries
17 Application. EnableVisualStyles ();
18 Application. SetCompatibleTextRenderingDefault (False);
19 Application. Run (NewForm1 ());
20 }
21 }
22 }
2. Form1.Designer. cs
1 NamespaceWinFormStudy
2 {
3 Partial ClassForm1
4 {
5 /// <Summary>
6 ///Required designer variables.
7 /// </Summary>
8 PrivateSystem. ComponentModel. IContainer components= Null;
9 /// <Summary>
10 ///Clear all resources in use.
11 /// </Summary>
12 /// <Param name = "disposing">If the managed resources should be released, the value is true; otherwise, the value is false.</Param>
13 Protected Override VoidDispose (BoolDisposing)
14 {
15 If(Disposing&&(Components! = Null))
16 {
17 Components. Dispose ();
18 }
19 <