Form1.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:5k
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data;
- using System.Reflection;
- using System.Resources;
- namespace ResourceDemo
- {
- /// <summary>
- /// Summary description for Form1.
- /// </summary>
- public class Form1 : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.TextBox textTitle;
- private System.Windows.Forms.TextBox textChapter;
- private System.Windows.Forms.TextBox textAuthor;
- private System.Windows.Forms.TextBox textPublisher;
- private System.Resources.ResourceManager rm;
- private System.Windows.Forms.PictureBox logo;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
- public Form1()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
- Assembly assembly = Assembly.GetExecutingAssembly();
- rm = new ResourceManager("ResourceDemo.Demo", assembly);
- logo.Image = (Image)rm.GetObject("WroxLogo");
- textTitle.Text = rm.GetString("Title");
- textChapter.Text = rm.GetString("Chapter");
- textAuthor.Text = rm.GetString("Author");
- textPublisher.Text = rm.GetString("Publisher");
- }
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if (components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.logo = new System.Windows.Forms.PictureBox();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.textTitle = new System.Windows.Forms.TextBox();
- this.textChapter = new System.Windows.Forms.TextBox();
- this.textAuthor = new System.Windows.Forms.TextBox();
- this.textPublisher = new System.Windows.Forms.TextBox();
- this.SuspendLayout();
- //
- // logo
- //
- this.logo.Location = new System.Drawing.Point(8, 8);
- this.logo.Name = "logo";
- this.logo.Size = new System.Drawing.Size(128, 96);
- this.logo.TabIndex = 0;
- this.logo.TabStop = false;
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(16, 128);
- this.label1.Name = "label1";
- this.label1.TabIndex = 0;
- this.label1.Text = "Title:";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(16, 160);
- this.label2.Name = "label2";
- this.label2.TabIndex = 2;
- this.label2.Text = "Chapter:";
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(16, 192);
- this.label3.Name = "label3";
- this.label3.TabIndex = 4;
- this.label3.Text = "Author:";
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(16, 224);
- this.label4.Name = "label4";
- this.label4.TabIndex = 6;
- this.label4.Text = "Publisher:";
- //
- // textTitle
- //
- this.textTitle.Location = new System.Drawing.Point(136, 128);
- this.textTitle.Name = "textTitle";
- this.textTitle.Size = new System.Drawing.Size(136, 20);
- this.textTitle.TabIndex = 1;
- this.textTitle.Text = "textTitle";
- //
- // textChapter
- //
- this.textChapter.Location = new System.Drawing.Point(136, 160);
- this.textChapter.Name = "textChapter";
- this.textChapter.Size = new System.Drawing.Size(136, 20);
- this.textChapter.TabIndex = 3;
- this.textChapter.Text = "textChapter";
- //
- // textAuthor
- //
- this.textAuthor.Location = new System.Drawing.Point(136, 192);
- this.textAuthor.Name = "textAuthor";
- this.textAuthor.Size = new System.Drawing.Size(136, 20);
- this.textAuthor.TabIndex = 5;
- this.textAuthor.Text = "textAuthor";
- //
- // textPublisher
- //
- this.textPublisher.Location = new System.Drawing.Point(136, 224);
- this.textPublisher.Name = "textPublisher";
- this.textPublisher.Size = new System.Drawing.Size(136, 20);
- this.textPublisher.TabIndex = 7;
- this.textPublisher.Text = "textPublisher";
- //
- // Form1
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.BackColor = System.Drawing.SystemColors.Desktop;
- this.ClientSize = new System.Drawing.Size(292, 273);
- this.Controls.Add(this.textPublisher);
- this.Controls.Add(this.textAuthor);
- this.Controls.Add(this.textChapter);
- this.Controls.Add(this.textTitle);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.logo);
- this.Name = "Form1";
- this.Text = "Resource Demo";
- this.ResumeLayout(false);
- }
- #endregion
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.Run(new Form1());
- }
- }
- }