创建一个窗体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文件构成说明的更多相关文章

  1. Day21 Django之Form文件上传、原生Ajax和实现抽屉实例

    一.Form文件上传 """ Django settings for prev_chouti project. Generated by 'django-admin st ...

  2. EBS查找当前Form文件

    http://www.cnblogs.com/benio/archive/2011/06/10/2077289.html 我们经常会要在ORACLE EBS中寻找我们正在浏览的form页面的执行文件, ...

  3. 解决myeclipse打开.form文件报错

    症状: 打开AutoEKPMainFrm.form文件的时候出现如下问题:

  4. IDEA无法新建GUI Form文件

    因为最近想开发一个IDEA的插件,所以在开发的过程中就需要创建Swing GUI Form文件.但是在项目中右键New中始终就是没有“GUI Form”这个选项,然后自己琢磨寻思着是不是没有启用Swi ...

  5. Form文件夹开发步骤

    1.开发完一个Form,测试OK 1.添加Object Groups 操作如下:在同一窗口打开标准的Form APPSTAND.FMB 和我们自己客制的Form,并且选择APPSTAND.FMB的Ob ...

  6. form文件上传,防止页面刷新

    <!DOCTYPE html><html><head><meta charset="UTF-8"><title>文件上传 ...

  7. Form -- 文件上传

    当我们选中文件,点击上传时即可. 而此按钮一般是一张图片覆盖了一个input标签而以.基于这个原理我们可以定制自己喜欢的样式 <div style="text-align: cente ...

  8. struts1 & jquery form 文件异步上传

    1.概述 还在用struts1?是的,在地球的没写地方,落后的生产方式还在运转(老项目). 从 继承org.apache.struts.action.Action, 继承org.apache.stru ...

  9. 从VisualStudio资源文件看.NET资源处理

    c# 工程里面,经常会添加资源文件. 作用: 一处文本多个地方的UI使用,最好把文本抽成资源,多处调用使用一处资源. 多语言版本支持,一份代码支持多国语言.配置多国语言的资源文件,调用处引用资源. 例 ...

随机推荐

  1. pascal矩阵

    帕斯卡矩阵 1.定义       帕斯卡矩阵:由杨辉三角形表组成的矩阵称为帕斯卡(Pascal)矩阵. 杨辉三角形表是二次项 (x+y)^n 展开后的系数随自然数 n 的增大组成的一个三角形表. 如4 ...

  2. PHP强制清除缓存

    在页面最顶端加上 <?phpheader("Expires: Mon, 26 Jul 1997 05:00:00 GMT");header("Last-Modifi ...

  3. 《苹果开发之Cocoa编程》挑战1 创建委托 练习

    <苹果开发之Cocoa编程>第4版 P87 新建一个单窗口应用程序,设置某对象为窗口的委托,当用户调整窗口尺寸时,确保窗口高度为宽度的2倍. 需要实现的委托方法为:-(NSSize)win ...

  4. PPT图片快速编辑技巧

    修改*.ppt或*.pptx的后缀名为zip 例如:demo.pptx修改为demo.zip 修改为, 使用压缩软件打开此压缩包, 一般图片资源都会存放在ppt/media下 找到你所要修改的图片,然 ...

  5. python文件操作--字符串替换

    如把test.txt文件的 所有 AAA 字符串 替换成 aaaaa with open('test.txt','+r') as f: t = f.read() t = d.replace('AAA' ...

  6. mysql+mybatis 插入可递增字段库表操作

    mysql本身类型介绍: BIGINT 8 字节 (-9 233 372 036 854 775 808,9 223 372 036 854 775 807) (0,18 446 744 073 70 ...

  7. 1分钟去除word文档编辑限制密码

    http://blog.sina.com.cn/s/blog_4bd446f30101dc4t.html

  8. struts2.0的工作原理

    struts2并不是一个陌生的web框架,它是以Webwork的设计思想为核心,吸收struts1的优点,可以说 struts2是struts1和Webwork结合的产物. struts2 的工作原理 ...

  9. Restfull API 示例

    什么是Restfull API Restfull API 从字面就可以知道,他是rest式的接口,所以就要先了解什么是rest rest 不是一个技术,也不是一个协议 rest 指的是一组架构约束条件 ...

  10. SQL Server锁、闩等资源的阻塞诊断---osql/sqlcmd,sp_blocker_pss80

          osql/sqlcmd 工具是一个 SqlServer的命令提示符工具,我们可以使用它运行 Transact-SQL 语句和脚本文件.该工具所在目录:C:\Program Files\Mi ...