FormAbout.cs
上传用户:hbhltzc
上传日期:2022-06-04
资源大小:1925k
文件大小:7k
源码类别:

xml/soap/webservice

开发平台:

Visual C++

  1. #region Using directives
  2. using System;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Runtime.InteropServices;
  9. using System.Drawing.Drawing2D;
  10. #endregion
  11. namespace XmlNotepad {
  12.     class FormAbout : Form {
  13.         public FormAbout() {
  14.             InitializeComponent();
  15.             this.labelVersion.Text = string.Format(this.labelVersion.Text, GetVersion());
  16.         }
  17.         string GetVersion(){
  18.             string name = GetType().Assembly.FullName;
  19.             string[] parts = name.Split(',');
  20.             if (parts.Length>1){
  21.                 string version = parts[1].Trim();
  22.                 parts = version.Split('=');
  23.                 if (parts.Length>1){
  24.                     return parts[1];
  25.                 }
  26.             }
  27.             return "1.0";
  28.         }
  29.         private Label label2;
  30.         private Label labelVersion;
  31.         private Label label1;
  32.         private Label labelURL;
  33.         private TableLayoutPanel tableLayoutPanel1;
  34.         /// <summary>
  35.         /// Required designer variable.
  36.         /// </summary>
  37.         private System.ComponentModel.IContainer components = null;
  38.         /// <summary>
  39.         /// Clean up any resources being used.
  40.         /// </summary>
  41.         protected override void Dispose(bool disposing) {
  42.             if (disposing && (components != null)) {
  43.                 components.Dispose();
  44.             }
  45.             base.Dispose(disposing);
  46.         }
  47.         protected override void OnPaintBackground(PaintEventArgs e) {
  48.             using (LinearGradientBrush brush = new LinearGradientBrush(new Point(0,0), new Point(0, this.Height),
  49.                 Color.White, Color.FromArgb(0xc0, 0xc0, 0xdd))) {
  50.                 e.Graphics.FillRectangle(brush, this.ClientRectangle);
  51.             }
  52.         }
  53.         #region Windows Form Designer generated code
  54.         /// <summary>
  55.         /// Required method for Designer support - do not modify
  56.         /// the contents of this method with the code editor.
  57.         /// </summary>
  58.         private void InitializeComponent() {
  59.             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAbout));
  60.             this.pictureBox1 = new System.Windows.Forms.PictureBox();
  61.             this.linkLabel1 = new System.Windows.Forms.LinkLabel();
  62.             this.buttonOK = new System.Windows.Forms.Button();
  63.             this.label2 = new System.Windows.Forms.Label();
  64.             this.labelVersion = new System.Windows.Forms.Label();
  65.             this.label1 = new System.Windows.Forms.Label();
  66.             this.labelURL = new System.Windows.Forms.Label();
  67.             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
  68.             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  69.             this.tableLayoutPanel1.SuspendLayout();
  70.             this.SuspendLayout();
  71.             // 
  72.             // pictureBox1
  73.             // 
  74.             this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
  75.             resources.ApplyResources(this.pictureBox1, "pictureBox1");
  76.             this.pictureBox1.Name = "pictureBox1";
  77.             this.pictureBox1.TabStop = false;
  78.             // 
  79.             // linkLabel1
  80.             // 
  81.             resources.ApplyResources(this.linkLabel1, "linkLabel1");
  82.             this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
  83.             this.linkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.System;
  84.             this.linkLabel1.Name = "linkLabel1";
  85.             this.linkLabel1.TabStop = true;
  86.             this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
  87.             // 
  88.             // buttonOK
  89.             // 
  90.             resources.ApplyResources(this.buttonOK, "buttonOK");
  91.             this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
  92.             this.buttonOK.Name = "buttonOK";
  93.             // 
  94.             // label2
  95.             // 
  96.             resources.ApplyResources(this.label2, "label2");
  97.             this.label2.BackColor = System.Drawing.Color.Transparent;
  98.             this.label2.Name = "label2";
  99.             // 
  100.             // labelVersion
  101.             // 
  102.             resources.ApplyResources(this.labelVersion, "labelVersion");
  103.             this.labelVersion.BackColor = System.Drawing.Color.Transparent;
  104.             this.labelVersion.Name = "labelVersion";
  105.             // 
  106.             // label1
  107.             // 
  108.             resources.ApplyResources(this.label1, "label1");
  109.             this.label1.BackColor = System.Drawing.Color.Transparent;
  110.             this.label1.Name = "label1";
  111.             // 
  112.             // labelURL
  113.             // 
  114.             resources.ApplyResources(this.labelURL, "labelURL");
  115.             this.labelURL.BackColor = System.Drawing.Color.Transparent;
  116.             this.labelURL.Name = "labelURL";
  117.             // 
  118.             // tableLayoutPanel1
  119.             // 
  120.             resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
  121.             this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
  122.             this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0);
  123.             this.tableLayoutPanel1.Controls.Add(this.labelURL, 0, 6);
  124.             this.tableLayoutPanel1.Controls.Add(this.labelVersion, 0, 1);
  125.             this.tableLayoutPanel1.Controls.Add(this.label1, 0, 2);
  126.             this.tableLayoutPanel1.Controls.Add(this.linkLabel1, 0, 5);
  127.             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
  128.             // 
  129.             // FormAbout
  130.             // 
  131.             this.AcceptButton = this.buttonOK;
  132.             this.CancelButton = this.buttonOK;
  133.             resources.ApplyResources(this, "$this");
  134.             this.Controls.Add(this.buttonOK);
  135.             this.Controls.Add(this.pictureBox1);
  136.             this.Controls.Add(this.tableLayoutPanel1);
  137.             this.Name = "FormAbout";
  138.             this.ShowInTaskbar = false;
  139.             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  140.             this.tableLayoutPanel1.ResumeLayout(false);
  141.             this.tableLayoutPanel1.PerformLayout();
  142.             this.ResumeLayout(false);
  143.         }
  144.         #endregion
  145.         private System.Windows.Forms.PictureBox pictureBox1;
  146.         private System.Windows.Forms.LinkLabel linkLabel1;
  147.         private System.Windows.Forms.Button buttonOK;
  148.         private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) {
  149.             string url = labelURL.Text;
  150.             Utilities.OpenUrl(this.Handle, url);
  151.         }
  152.     }
  153. }