Form1.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. using System.Data;
  7. namespace TextLoginBox
  8. {
  9. /// <summary>
  10. /// Form1 的摘要说明。
  11. /// </summary>
  12. public class Form1 : System.Windows.Forms.Form
  13. {
  14. private ch9_2.loginBox loginBox1;
  15. private System.Windows.Forms.Label label1;
  16. /// <summary>
  17. /// 必需的设计器变量。
  18. /// </summary>
  19. private System.ComponentModel.Container components = null;
  20. public Form1()
  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.loginBox1 = new ch9_2.loginBox();
  52. this.label1 = new System.Windows.Forms.Label();
  53. this.SuspendLayout();
  54. // 
  55. // loginBox1
  56. // 
  57. this.loginBox1.Location = new System.Drawing.Point(88, 96);
  58. this.loginBox1.LoginText = ch9_2.LoginButtonText.登录;
  59. this.loginBox1.Name = "loginBox1";
  60. this.loginBox1.Password = "********";
  61. this.loginBox1.Size = new System.Drawing.Size(96, 136);
  62. this.loginBox1.TabIndex = 0;
  63. this.loginBox1.Username = "请输入用户名";
  64. this.loginBox1.LoginButtonClick += new System.EventHandler(this.loginBox1_LoginButtonClick);
  65. // 
  66. // label1
  67. // 
  68. this.label1.Location = new System.Drawing.Point(48, 40);
  69. this.label1.Name = "label1";
  70. this.label1.Size = new System.Drawing.Size(176, 23);
  71. this.label1.TabIndex = 1;
  72. this.label1.Text = "LoginBox控件示例";
  73. this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  74. // 
  75. // Form1
  76. // 
  77. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  78. this.ClientSize = new System.Drawing.Size(280, 273);
  79. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  80.   this.label1,
  81.   this.loginBox1});
  82. this.Name = "Form1";
  83. this.Text = "LoginBox控件示例";
  84. this.ResumeLayout(false);
  85. }
  86. #endregion
  87. /// <summary>
  88. /// 应用程序的主入口点。
  89. /// </summary>
  90. [STAThread]
  91. static void Main() 
  92. {
  93. Application.Run(new Form1());
  94. }
  95. private void loginBox1_LoginButtonClick(object sender, System.EventArgs e)
  96. {
  97. MessageBox.Show("欢迎你的访问!");
  98. }
  99. }
  100. }