Handwritten code note (1) -- write a drag button

Source: Internet
Author: User

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 <

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.