Phone.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:3k
源码类别:

C#编程

开发平台:

Others

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. namespace SimpleWinApp
  7. {
  8. /// <summary>
  9. /// Summary description for Phone.
  10. /// </summary>
  11. public class Phone : System.Windows.Forms.Form
  12. {
  13.     private System.Windows.Forms.TextBox txtPhone;
  14.     private System.Windows.Forms.Button btnOK;
  15.     private System.Windows.Forms.Button btnCancel;
  16.     private System.Windows.Forms.Label label1;
  17. /// <summary>
  18. /// Required designer variable.
  19. /// </summary>
  20. private System.ComponentModel.Container components = null;
  21. public Phone()
  22. {
  23. //
  24. // Required for Windows Form Designer support
  25. //
  26. InitializeComponent();
  27. //
  28. // TODO: Add any constructor code after InitializeComponent call
  29. //
  30. }
  31. /// <summary>
  32. /// Clean up any resources being used.
  33. /// </summary>
  34. protected override void Dispose( bool disposing )
  35. {
  36. if( disposing )
  37. {
  38. if(components != null)
  39. {
  40. components.Dispose();
  41. }
  42. }
  43. base.Dispose( disposing );
  44. }
  45. #region Windows Form Designer generated code
  46. /// <summary>
  47. /// Required method for Designer support - do not modify
  48. /// the contents of this method with the code editor.
  49. /// </summary>
  50. private void InitializeComponent()
  51. {
  52.       this.txtPhone = new System.Windows.Forms.TextBox();
  53.       this.btnOK = new System.Windows.Forms.Button();
  54.       this.btnCancel = new System.Windows.Forms.Button();
  55.       this.label1 = new System.Windows.Forms.Label();
  56.       this.SuspendLayout();
  57.       // 
  58.       // txtPhone
  59.       // 
  60.       this.txtPhone.Location = new System.Drawing.Point(112, 32);
  61.       this.txtPhone.Name = "txtPhone";
  62.       this.txtPhone.TabIndex = 0;
  63.       this.txtPhone.Text = "";
  64.       // 
  65.       // btnOK
  66.       // 
  67.       this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
  68.       this.btnOK.Location = new System.Drawing.Point(48, 88);
  69.       this.btnOK.Name = "btnOK";
  70.       this.btnOK.TabIndex = 1;
  71.       this.btnOK.Text = "OK";
  72.       // 
  73.       // btnCancel
  74.       // 
  75.       this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  76.       this.btnCancel.Location = new System.Drawing.Point(152, 88);
  77.       this.btnCancel.Name = "btnCancel";
  78.       this.btnCancel.TabIndex = 2;
  79.       this.btnCancel.Text = "Cancel";
  80.       // 
  81.       // label1
  82.       // 
  83.       this.label1.Location = new System.Drawing.Point(8, 32);
  84.       this.label1.Name = "label1";
  85.       this.label1.TabIndex = 3;
  86.       this.label1.Text = "Enter Phone #:";
  87.       this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  88.       // 
  89.       // Phone
  90.       // 
  91.       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  92.       this.ClientSize = new System.Drawing.Size(264, 155);
  93.       this.ControlBox = false;
  94.       this.Controls.Add(this.label1);
  95.       this.Controls.Add(this.btnCancel);
  96.       this.Controls.Add(this.btnOK);
  97.       this.Controls.Add(this.txtPhone);
  98.       this.HelpButton = true;
  99.       this.MaximizeBox = false;
  100.       this.MinimizeBox = false;
  101.       this.Name = "Phone";
  102.       this.ShowInTaskbar = false;
  103.       this.Text = "Phone";
  104.       this.ResumeLayout(false);
  105.     }
  106. #endregion
  107.     public string PhoneNumber
  108.     {
  109.       get {return txtPhone.Text;}
  110.       set {txtPhone.Text = value;}
  111.     }
  112. }
  113. }