FormAbout.cs
上传用户:hbhltzc
上传日期:2022-06-04
资源大小:1925k
文件大小:7k
源码类别:
xml/soap/webservice
开发平台:
Visual C++
- #region Using directives
- using System;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- using System.Drawing.Drawing2D;
- #endregion
- namespace XmlNotepad {
- class FormAbout : Form {
- public FormAbout() {
- InitializeComponent();
- this.labelVersion.Text = string.Format(this.labelVersion.Text, GetVersion());
- }
- string GetVersion(){
- string name = GetType().Assembly.FullName;
- string[] parts = name.Split(',');
- if (parts.Length>1){
- string version = parts[1].Trim();
- parts = version.Split('=');
- if (parts.Length>1){
- return parts[1];
- }
- }
- return "1.0";
- }
- private Label label2;
- private Label labelVersion;
- private Label label1;
- private Label labelURL;
- private TableLayoutPanel tableLayoutPanel1;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose(bool disposing) {
- if (disposing && (components != null)) {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- protected override void OnPaintBackground(PaintEventArgs e) {
- using (LinearGradientBrush brush = new LinearGradientBrush(new Point(0,0), new Point(0, this.Height),
- Color.White, Color.FromArgb(0xc0, 0xc0, 0xdd))) {
- e.Graphics.FillRectangle(brush, this.ClientRectangle);
- }
- }
- #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() {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAbout));
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
- this.linkLabel1 = new System.Windows.Forms.LinkLabel();
- this.buttonOK = new System.Windows.Forms.Button();
- this.label2 = new System.Windows.Forms.Label();
- this.labelVersion = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.labelURL = new System.Windows.Forms.Label();
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
- this.tableLayoutPanel1.SuspendLayout();
- this.SuspendLayout();
- //
- // pictureBox1
- //
- this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
- resources.ApplyResources(this.pictureBox1, "pictureBox1");
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.TabStop = false;
- //
- // linkLabel1
- //
- resources.ApplyResources(this.linkLabel1, "linkLabel1");
- this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
- this.linkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.System;
- this.linkLabel1.Name = "linkLabel1";
- this.linkLabel1.TabStop = true;
- this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
- //
- // buttonOK
- //
- resources.ApplyResources(this.buttonOK, "buttonOK");
- this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
- this.buttonOK.Name = "buttonOK";
- //
- // label2
- //
- resources.ApplyResources(this.label2, "label2");
- this.label2.BackColor = System.Drawing.Color.Transparent;
- this.label2.Name = "label2";
- //
- // labelVersion
- //
- resources.ApplyResources(this.labelVersion, "labelVersion");
- this.labelVersion.BackColor = System.Drawing.Color.Transparent;
- this.labelVersion.Name = "labelVersion";
- //
- // label1
- //
- resources.ApplyResources(this.label1, "label1");
- this.label1.BackColor = System.Drawing.Color.Transparent;
- this.label1.Name = "label1";
- //
- // labelURL
- //
- resources.ApplyResources(this.labelURL, "labelURL");
- this.labelURL.BackColor = System.Drawing.Color.Transparent;
- this.labelURL.Name = "labelURL";
- //
- // tableLayoutPanel1
- //
- resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
- this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
- this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0);
- this.tableLayoutPanel1.Controls.Add(this.labelURL, 0, 6);
- this.tableLayoutPanel1.Controls.Add(this.labelVersion, 0, 1);
- this.tableLayoutPanel1.Controls.Add(this.label1, 0, 2);
- this.tableLayoutPanel1.Controls.Add(this.linkLabel1, 0, 5);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- //
- // FormAbout
- //
- this.AcceptButton = this.buttonOK;
- this.CancelButton = this.buttonOK;
- resources.ApplyResources(this, "$this");
- this.Controls.Add(this.buttonOK);
- this.Controls.Add(this.pictureBox1);
- this.Controls.Add(this.tableLayoutPanel1);
- this.Name = "FormAbout";
- this.ShowInTaskbar = false;
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
- this.tableLayoutPanel1.ResumeLayout(false);
- this.tableLayoutPanel1.PerformLayout();
- this.ResumeLayout(false);
- }
- #endregion
- private System.Windows.Forms.PictureBox pictureBox1;
- private System.Windows.Forms.LinkLabel linkLabel1;
- private System.Windows.Forms.Button buttonOK;
- private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) {
- string url = labelURL.Text;
- Utilities.OpenUrl(this.Handle, url);
- }
- }
- }