Form2.cs
Upload User: chinafred
Upload Date: 2007-08-14
Package Size: 10127k
Code Size: 3k
Category:

ADO-ODBC

Development Platform:

C#

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. namespace ch5_4
  7. {
  8. /// <summary>
  9. /// Form2 的摘要说明。
  10. /// </summary>
  11. public class Form2 : System.Windows.Forms.Form
  12. {
  13. public  System.Windows.Forms.ComboBox comboBox1;
  14. private System.Windows.Forms.Button button1;
  15. private System.Windows.Forms.Button button2;
  16. /// <summary>
  17. /// 必需的设计器变量。
  18. /// </summary>
  19. private System.ComponentModel.Container components = null;
  20. public Form2()
  21. {
  22. //
  23. // Windows 窗体设计器支持所必需的
  24. //
  25. InitializeComponent();
  26. //
  27. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  28. //
  29. }
  30. /// <summary>
  31. /// 清理所有正在使用的资源。
  32. /// </summary>
  33. protected override void Dispose( bool disposing )
  34. {
  35. if( disposing )
  36. {
  37. if(components != null)
  38. {
  39. components.Dispose();
  40. }
  41. }
  42. base.Dispose( disposing );
  43. }
  44. #region Windows Form Designer generated code
  45. /// <summary>
  46. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  47. /// 此方法的内容。
  48. /// </summary>
  49. private void InitializeComponent()
  50. {
  51. this.comboBox1 = new System.Windows.Forms.ComboBox();
  52. this.button1 = new System.Windows.Forms.Button();
  53. this.button2 = new System.Windows.Forms.Button();
  54. this.SuspendLayout();
  55. // 
  56. // comboBox1
  57. // 
  58. this.comboBox1.Location = new System.Drawing.Point(16, 16);
  59. this.comboBox1.Name = "comboBox1";
  60. this.comboBox1.Size = new System.Drawing.Size(216, 20);
  61. this.comboBox1.TabIndex = 0;
  62. // 
  63. // button1
  64. // 
  65. this.button1.Location = new System.Drawing.Point(256, 16);
  66. this.button1.Name = "button1";
  67. this.button1.TabIndex = 1;
  68. this.button1.Text = "确定";
  69. this.button1.Click += new System.EventHandler(this.button1_Click);
  70. // 
  71. // button2
  72. // 
  73. this.button2.Location = new System.Drawing.Point(256, 48);
  74. this.button2.Name = "button2";
  75. this.button2.TabIndex = 2;
  76. this.button2.Text = "取消";
  77. this.button2.Click += new System.EventHandler(this.button2_Click);
  78. // 
  79. // Form2
  80. // 
  81. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  82. this.ClientSize = new System.Drawing.Size(344, 85);
  83. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  84.   this.button2,
  85.   this.button1,
  86.   this.comboBox1});
  87. this.Name = "Form2";
  88. this.Text = "打开位置";
  89. this.ResumeLayout(false);
  90. }
  91. #endregion
  92. private void button1_Click(object sender, System.EventArgs e)
  93. {
  94. //设置窗体的DialogResult并退出
  95. this.DialogResult=DialogResult.OK;
  96. this.Close();
  97. }
  98. private void button2_Click(object sender, System.EventArgs e)
  99. {
  100. //设置窗体的DialogResult并退出
  101. this.DialogResult=DialogResult.Cancel;
  102. this.Close();
  103. }
  104. }
  105. }