⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aboutdialog.cs

📁 c#精彩编程百例(源代码)
💻 CS
字号:
//  AboutDialog.cs 
//  Copyright (c) 2000 Mike Krueger
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

using System;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Resources;
using System.IO;

using SharpDevelop.Gui;
using SharpDevelop.Tool.Data;

namespace SharpDevelop.Gui.Dialogs {
	
	/// <summary>
	/// Simple About Dialog
	/// </summary>
	public class AboutDialog : System.Windows.Forms.Form 
	{
		private System.ComponentModel.Container  components;
		private System.Windows.Forms.Label       label4;
		private System.Windows.Forms.Button      okButton;
		private System.Windows.Forms.Label       label3;
		private System.Windows.Forms.RichTextBox authorsTextBox;
		
		private System.Windows.Forms.TextBox    buildTextBox;
		private System.Windows.Forms.TextBox    versionTextBox;
		private System.Windows.Forms.Label      label2;
		private System.Windows.Forms.Label      label1;
		private System.Windows.Forms.PictureBox pictureBox1;
		
		public AboutDialog() 
		{
			
			InitializeComponent();
			
			pictureBox1.Image = Resource.GetBitmap("Icons.AboutImage");
			
			authorsTextBox.LoadFile(Application.StartupPath + "\\AUTHORS", RichTextBoxStreamType.PlainText);
			versionTextBox.Text = SharpDevelopMain.VERSION;
			buildTextBox.Text   = SharpDevelopMain.BUILD;
			AcceptButton        = okButton;
			
			MaximizeBox  = MinimizeBox = false;
			ShowInTaskbar = false;
			
			Icon = null;
		}
		
		public override void Dispose() 
		{
			base.Dispose();
			components.Dispose();
		}
		
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.authorsTextBox = new System.Windows.Forms.RichTextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.okButton = new System.Windows.Forms.Button();
			this.versionTextBox = new System.Windows.Forms.TextBox();
			this.buildTextBox = new System.Windows.Forms.TextBox();
			
			authorsTextBox.ReadOnly = true;
			authorsTextBox.Text = "";
			authorsTextBox.Size = new System.Drawing.Size(320, 120);
			authorsTextBox.TabIndex = 5;
			authorsTextBox.Location = new System.Drawing.Point(8, 192 + 32);
			
			label4.Location = new System.Drawing.Point(16, 112+ 32);
			label4.Text = "Released under the GNU General Public licens" + 
				"e.\n\nsponsored by AlphaSierraPapa \n" +
			        "                   www.AlphaSierraPapa.com";
			label4.Size = new System.Drawing.Size(362, 48);
			label4.TabIndex = 8;
			
			label1.Location = new System.Drawing.Point(9, 83+ 32);
			label1.Text = Resource.GetString("Dialog.About.label1Text");
			label1.Size = new System.Drawing.Size(64, 16);
			label1.TabIndex = 1;
			
			label3.Location = new System.Drawing.Point(8, 176+ 32);
			label3.Text = Resource.GetString("Dialog.About.label3Text");
			label3.Size = new System.Drawing.Size(64, 16);
			label3.TabIndex = 6;
			
			label2.Location = new System.Drawing.Point(142, 83+ 32);
			label2.Text = Resource.GetString("Dialog.About.label2Text");
			label2.Size = new System.Drawing.Size(48, 16);
			label2.TabIndex = 2;
			
			pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			pictureBox1.Location = new System.Drawing.Point(8, 8);
			pictureBox1.Size = new System.Drawing.Size(320, 64 + 32);
			pictureBox1.TabIndex = 0;
			pictureBox1.TabStop = false;
			
			okButton.Location = new System.Drawing.Point(264, 320+ 32);
			okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
			okButton.Size = new System.Drawing.Size(64, 24);
			okButton.TabIndex = 7;
			okButton.Text = Resource.GetString("Global.OKButtonText");
			
			versionTextBox.Location = new System.Drawing.Point(56, 80+ 32);
			versionTextBox.ReadOnly = true;
			versionTextBox.Text = "";
			versionTextBox.TabIndex = 3;
			versionTextBox.Size = new System.Drawing.Size(72, 20);
			
			buildTextBox.Location = new System.Drawing.Point(176, 80+ 32);
			buildTextBox.Text = "";
			buildTextBox.ReadOnly = true;
			buildTextBox.TabIndex = 4;
			buildTextBox.Size = new System.Drawing.Size(152, 20);
			
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.Text = Resource.GetString("Dialog.About.DialogName");
			
			this.FormBorderStyle = FormBorderStyle.FixedDialog;
			
			this.ClientSize = new System.Drawing.Size(338, 351+ 32);
			
			this.Controls.Add(label4);
			this.Controls.Add(okButton);
			this.Controls.Add(label3);
			this.Controls.Add(authorsTextBox);
			this.Controls.Add(buildTextBox);
			this.Controls.Add(versionTextBox);
			this.Controls.Add(label2);
			this.Controls.Add(label1);
			this.Controls.Add(pictureBox1);
			StartPosition = FormStartPosition.CenterParent;
//			TopMost       = true;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -