- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
Form2.cs
资源名称:VC#.NET范例.rar [点击查看]
上传用户:chinafred
上传日期:2007-08-14
资源大小:10127k
文件大小:3k
源码类别:
数据库编程
开发平台:
C#
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- namespace ch5_4
- {
- /// <summary>
- /// Form2 的摘要说明。
- /// </summary>
- public class Form2 : System.Windows.Forms.Form
- {
- public System.Windows.Forms.ComboBox comboBox1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
- /// <summary>
- /// 必需的设计器变量。
- /// </summary>
- private System.ComponentModel.Container components = null;
- public Form2()
- {
- //
- // Windows 窗体设计器支持所必需的
- //
- InitializeComponent();
- //
- // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
- //
- }
- /// <summary>
- /// 清理所有正在使用的资源。
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // comboBox1
- //
- this.comboBox1.Location = new System.Drawing.Point(16, 16);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(216, 20);
- this.comboBox1.TabIndex = 0;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(256, 16);
- this.button1.Name = "button1";
- this.button1.TabIndex = 1;
- this.button1.Text = "确定";
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(256, 48);
- this.button2.Name = "button2";
- this.button2.TabIndex = 2;
- this.button2.Text = "取消";
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // Form2
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.ClientSize = new System.Drawing.Size(344, 85);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.button2,
- this.button1,
- this.comboBox1});
- this.Name = "Form2";
- this.Text = "打开位置";
- this.ResumeLayout(false);
- }
- #endregion
- private void button1_Click(object sender, System.EventArgs e)
- {
- //设置窗体的DialogResult并退出
- this.DialogResult=DialogResult.OK;
- this.Close();
- }
- private void button2_Click(object sender, System.EventArgs e)
- {
- //设置窗体的DialogResult并退出
- this.DialogResult=DialogResult.Cancel;
- this.Close();
- }
- }
- }