VisualStudio Form文件构成说明
创建一个窗体Form1.cs 后,在他的下一级,有两个子文件: Form1.Designer.cs 和Form1.resx 这两个子文件

Form1.Designer.cs是VS自动生成用作UI的绘制以及事件绑定的代码;
Form1.resx可以用来存储资源,比如窗体上的字符串、图片等。
Form1.designer.cs 是对应Form1.cs的,他实际上是Form1那个Form1类的一部分,里面主要的方法 private void InitializeComponent()内部是把你 通过设计器 拖拽过去的 控件在这里实现,也就是说实际上你拖一个控件,这边对应生成代码,然后 在Form1 的 构造器里调用他,所以你接着就可以在 form1.cs 内部 访问到这些 控件了;
Form1.resx 是资源导入用的 比如一些图片和 音乐之类的 你可以通过它导入到项目中 这样 生成的时候 就 不需要引用外部的文件了
designer.cs代码:
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region Windows Form Designer generated code /// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonXX = new System.Windows.Forms.Button();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// button1
//
this.buttonXX.Location = new System.Drawing.Point(, );
this.buttonXX.Name = "button1";
this.buttonXX.Size = new System.Drawing.Size(, );
this.buttonXX.TabIndex = ;
this.buttonXX.Text = "button1";
this.buttonXX.UseVisualStyleBackColor = true;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(, );
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(, );
this.checkBox1.TabIndex = ;
this.checkBox1.Text = "checkBox1";
this.checkBox1.UseVisualStyleBackColor = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.buttonXX);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout(); } #endregion private System.Windows.Forms.Button buttonXX;
private System.Windows.Forms.CheckBox checkBox1;
}
VisualStudio Form文件构成说明的更多相关文章
- Day21 Django之Form文件上传、原生Ajax和实现抽屉实例
一.Form文件上传 """ Django settings for prev_chouti project. Generated by 'django-admin st ...
- EBS查找当前Form文件
http://www.cnblogs.com/benio/archive/2011/06/10/2077289.html 我们经常会要在ORACLE EBS中寻找我们正在浏览的form页面的执行文件, ...
- 解决myeclipse打开.form文件报错
症状: 打开AutoEKPMainFrm.form文件的时候出现如下问题:
- IDEA无法新建GUI Form文件
因为最近想开发一个IDEA的插件,所以在开发的过程中就需要创建Swing GUI Form文件.但是在项目中右键New中始终就是没有“GUI Form”这个选项,然后自己琢磨寻思着是不是没有启用Swi ...
- Form文件夹开发步骤
1.开发完一个Form,测试OK 1.添加Object Groups 操作如下:在同一窗口打开标准的Form APPSTAND.FMB 和我们自己客制的Form,并且选择APPSTAND.FMB的Ob ...
- form文件上传,防止页面刷新
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>文件上传 ...
- Form -- 文件上传
当我们选中文件,点击上传时即可. 而此按钮一般是一张图片覆盖了一个input标签而以.基于这个原理我们可以定制自己喜欢的样式 <div style="text-align: cente ...
- struts1 & jquery form 文件异步上传
1.概述 还在用struts1?是的,在地球的没写地方,落后的生产方式还在运转(老项目). 从 继承org.apache.struts.action.Action, 继承org.apache.stru ...
- 从VisualStudio资源文件看.NET资源处理
c# 工程里面,经常会添加资源文件. 作用: 一处文本多个地方的UI使用,最好把文本抽成资源,多处调用使用一处资源. 多语言版本支持,一份代码支持多国语言.配置多国语言的资源文件,调用处引用资源. 例 ...
随机推荐
- Js的引用赋值与传值赋值
要说js的赋值方式时首先要说明js的数值类型:基本类型和引用类型. 1.基本类型 基本的数据类型有:undefined,boolean,number,string,null. 基本类型存放在栈区,访问 ...
- com.google.guava 包解析 ——Google Guava官方教程(中文版)
全网址 http://ifeve.com/google-guava/ 竹子博客: http://www.cnblogs.com/peida/archive/2013/06/08/ ...
- makefile--目标搜索(八)
原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/ 在一个较大的工程中,一般会将源代码和二进制文件(.o 文件和可执行文件)安排在不同的目录来进行区 ...
- UVa 839 天平
原题链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- leetcode 119 Pascal's Triangle II ----- java
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3, ...
- Codeforces Round #137 (Div. 2)
A. Shooshuns and Sequence 显然\([k,n]\)之间所有数均要相同,为了求最少步数,即最多模拟\(n\)次操作即可. B. Cosmic Tables 映射\(x_i,y_i ...
- 2-1-1 GDI
主要内容:介绍Windows图形设备接口(GDI)及相关概念 1.Windows图形设备接口(GDI) <1>Windows图形设备接口(GDI),是为与设备无关的图形设计的. 所谓设备 ...
- hive权限管理之实践
一.实践心得 主要参考这个连接,里面说得也挺详细的.http://www.aboutyun.com/thread-12549-1-1.html 总结如下: 1.若赋予用户某个表的权限,查用户在该表所属 ...
- URAL 1056 Computer Net(最短路)
Computer Net Time limit: 2.0 secondMemory limit: 64 MB Background Computer net is created by consecu ...
- 【原创】Algorithms:原地归并排序
第一次归并: a[0] a[1] a[2] a[3] a[4] a[5] a[6] 23 8 19 33 15 6 27 ↑ ↑ i j 最开始i指向a[0],j指向a ...