当前位置:编程学习 > asp >>

手写代码小记(1)——写一个拖出的button

今天开始玩玩手写的窗体代码,也为学习编码做个训练吧......

      WindowsFormsApplication在创建时会自动创建一些文件,下一创建WinFormStudy为例,下面看看各个文件中的代码:

1、Program.cs

1 using System;
2  using System.Collections.Generic;
3  using System.Linq;
4  using System.Windows.Forms;
5
6  namespace WinFormStudy
7 {
8 static class Program
9 {
10 /// <summary>
11 /// 应用程序的主入口点。
12 /// </summary>
13   [STAThread]
14 static void Main()
15 {
16 ///Application能点出45个内容
17   Application.EnableVisualStyles();
18 Application.SetCompatibleTextRenderingDefault(false);
19 Application.Run(new Form1());
20 }
21 }
22 }

2、Form1.Designer.cs

1 namespace WinFormStudy
2 {
3 partial class Form1
4 {
5 /// <summary>
6 /// 必需的设计器变量。
7 /// </summary>
8   private System.ComponentModel.IContainer components = null;
9 /// <summary>
10 /// 清理所有正在使用的资源。
11 /// </summary>
12 /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
13   protected override void Dispose(bool disposing)
14 {
15 if (disposing && (components != null))
16 {
17 components.Dispose();
18 }
19 <
补充:Web开发 , ASP.Net ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,