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部分---类型,变量;
			
<script type="text/javascript">1.注释:用“//或者/**/”2.数据类型: (1)整型 int (2)小数类型 单精度float 双精 ...
 - UVa 1593代码对齐
			
原题链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
 - LeetCode(228) Summary Ranges
			
Given a sorted integer array without duplicates, return the summary of its ranges. For example, give ...
 - 通过UserAgent判断智能手机(设备,Android,IOS)
			
转:http://free0007.iteye.com/blog/2017329 /// 根据 Agent 判断是否是智能手机 ///</summary> ///<returns&g ...
 - memcached +mysql+php 测试例子
			
最近看了看memcached 缓存 mysql,经过一段时间的研究·把自己测试方法写出来,给像我一样的初学者用~我的环境是 nginx + php-fpm + apc + mysql 编译安装memc ...
 - ABBYY FineReader无法打开TWAIN源怎么办
			
ABBYY FineReader OCR文字识别软件不仅可以将PDF文档和图像文件(包括数码照片)转换为可编辑.可搜索的格式,还可以用来扫描文档,但在扫描过程中,有时可能会出现以下两种错误信息:一是无 ...
 - SQLServer中临时表与表变量的区别分析
			
临时表 临时表与永久表相似,只是它的创建是在Tempdb中,它只有在一个数据库连接结束后或者由SQL命令DROP掉,才会消失,否则就会一直存在.临时表在创建的时候都会产生SQL Server的系统日志 ...
 - SVG 箭头线绘制
			
SVG并没有提供原生的Arrow标签,这就需要自己的组合了,通过marker标签和path标签可以完美的模仿出箭头线,无论需要多少个箭头线,只需引用同一个marker即可: <svg id=&q ...
 - Kettle合并记录步骤
			
转载: http://blog.itpub.net/post/37422/464323 该步骤用于将两个不同来源的数据合并,这两个来源的数据分别为旧数据和新数据,该步骤将旧数据和新数据按照指定的关键字 ...
 - python批量制作雷达图
			
老板要画雷达图,但是数据好多组怎么办?不能一个一个点excel去画吧,那么可以利用python进行批量制作,得到样式如下: 首先制作一个演示的excel,评分为excel随机数生成: 1 =INT(( ...