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

C#编程

开发平台:

Others

  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. using System.Reflection;
  8. using System.Resources;
  9. namespace ResourceDemo
  10. {
  11. /// <summary>
  12. /// Summary description for Form1.
  13. /// </summary>
  14. public class Form1 : System.Windows.Forms.Form
  15. {
  16. private System.Windows.Forms.Label label1;
  17. private System.Windows.Forms.Label label2;
  18. private System.Windows.Forms.Label label3;
  19. private System.Windows.Forms.Label label4;
  20. private System.Windows.Forms.TextBox textTitle;
  21. private System.Windows.Forms.TextBox textChapter;
  22. private System.Windows.Forms.TextBox textAuthor;
  23. private System.Windows.Forms.TextBox textPublisher;
  24. private System.Resources.ResourceManager rm;
  25. private System.Windows.Forms.PictureBox logo;
  26. /// <summary>
  27. /// Required designer variable.
  28. /// </summary>
  29. private System.ComponentModel.Container components = null;
  30. public Form1()
  31. {
  32. //
  33. // Required for Windows Form Designer support
  34. //
  35. InitializeComponent();
  36. Assembly assembly = Assembly.GetExecutingAssembly();
  37. rm = new ResourceManager("ResourceDemo.Demo", assembly);
  38. logo.Image = (Image)rm.GetObject("WroxLogo");
  39. textTitle.Text = rm.GetString("Title");
  40. textChapter.Text = rm.GetString("Chapter");
  41. textAuthor.Text = rm.GetString("Author");
  42. textPublisher.Text = rm.GetString("Publisher");
  43. }
  44. /// <summary>
  45. /// Clean up any resources being used.
  46. /// </summary>
  47. protected override void Dispose( bool disposing )
  48. {
  49. if( disposing )
  50. {
  51. if (components != null) 
  52. {
  53. components.Dispose();
  54. }
  55. }
  56. base.Dispose( disposing );
  57. }
  58. #region Windows Form Designer generated code
  59. /// <summary>
  60. /// Required method for Designer support - do not modify
  61. /// the contents of this method with the code editor.
  62. /// </summary>
  63. private void InitializeComponent()
  64. {
  65. this.logo = new System.Windows.Forms.PictureBox();
  66. this.label1 = new System.Windows.Forms.Label();
  67. this.label2 = new System.Windows.Forms.Label();
  68. this.label3 = new System.Windows.Forms.Label();
  69. this.label4 = new System.Windows.Forms.Label();
  70. this.textTitle = new System.Windows.Forms.TextBox();
  71. this.textChapter = new System.Windows.Forms.TextBox();
  72. this.textAuthor = new System.Windows.Forms.TextBox();
  73. this.textPublisher = new System.Windows.Forms.TextBox();
  74. this.SuspendLayout();
  75. // 
  76. // logo
  77. // 
  78. this.logo.Location = new System.Drawing.Point(8, 8);
  79. this.logo.Name = "logo";
  80. this.logo.Size = new System.Drawing.Size(128, 96);
  81. this.logo.TabIndex = 0;
  82. this.logo.TabStop = false;
  83. // 
  84. // label1
  85. // 
  86. this.label1.Location = new System.Drawing.Point(16, 128);
  87. this.label1.Name = "label1";
  88. this.label1.TabIndex = 0;
  89. this.label1.Text = "Title:";
  90. // 
  91. // label2
  92. // 
  93. this.label2.Location = new System.Drawing.Point(16, 160);
  94. this.label2.Name = "label2";
  95. this.label2.TabIndex = 2;
  96. this.label2.Text = "Chapter:";
  97. // 
  98. // label3
  99. // 
  100. this.label3.Location = new System.Drawing.Point(16, 192);
  101. this.label3.Name = "label3";
  102. this.label3.TabIndex = 4;
  103. this.label3.Text = "Author:";
  104. // 
  105. // label4
  106. // 
  107. this.label4.Location = new System.Drawing.Point(16, 224);
  108. this.label4.Name = "label4";
  109. this.label4.TabIndex = 6;
  110. this.label4.Text = "Publisher:";
  111. // 
  112. // textTitle
  113. // 
  114. this.textTitle.Location = new System.Drawing.Point(136, 128);
  115. this.textTitle.Name = "textTitle";
  116. this.textTitle.Size = new System.Drawing.Size(136, 20);
  117. this.textTitle.TabIndex = 1;
  118. this.textTitle.Text = "textTitle";
  119. // 
  120. // textChapter
  121. // 
  122. this.textChapter.Location = new System.Drawing.Point(136, 160);
  123. this.textChapter.Name = "textChapter";
  124. this.textChapter.Size = new System.Drawing.Size(136, 20);
  125. this.textChapter.TabIndex = 3;
  126. this.textChapter.Text = "textChapter";
  127. // 
  128. // textAuthor
  129. // 
  130. this.textAuthor.Location = new System.Drawing.Point(136, 192);
  131. this.textAuthor.Name = "textAuthor";
  132. this.textAuthor.Size = new System.Drawing.Size(136, 20);
  133. this.textAuthor.TabIndex = 5;
  134. this.textAuthor.Text = "textAuthor";
  135. // 
  136. // textPublisher
  137. // 
  138. this.textPublisher.Location = new System.Drawing.Point(136, 224);
  139. this.textPublisher.Name = "textPublisher";
  140. this.textPublisher.Size = new System.Drawing.Size(136, 20);
  141. this.textPublisher.TabIndex = 7;
  142. this.textPublisher.Text = "textPublisher";
  143. // 
  144. // Form1
  145. // 
  146. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  147. this.BackColor = System.Drawing.SystemColors.Desktop;
  148. this.ClientSize = new System.Drawing.Size(292, 273);
  149. this.Controls.Add(this.textPublisher);
  150. this.Controls.Add(this.textAuthor);
  151. this.Controls.Add(this.textChapter);
  152. this.Controls.Add(this.textTitle);
  153. this.Controls.Add(this.label4);
  154. this.Controls.Add(this.label3);
  155. this.Controls.Add(this.label2);
  156. this.Controls.Add(this.label1);
  157. this.Controls.Add(this.logo);
  158. this.Name = "Form1";
  159. this.Text = "Resource Demo";
  160. this.ResumeLayout(false);
  161. }
  162. #endregion
  163. /// <summary>
  164. /// The main entry point for the application.
  165. /// </summary>
  166. [STAThread]
  167. static void Main() 
  168. {
  169. Application.Run(new Form1());
  170. }
  171. }
  172. }