Author:水如烟
MS2005自带的About Box内容太少,觉得也不大好看。所以自做一个。这回我不说操作过程了,不清楚的话,可以参考我的另一文《HOW TO:溅射屏幕(Splash Screen),也叫程序启动画面的制作(.NET2005)》。界面如图:
文件AboutForm.Designer.vb代码:
代码
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class AboutFormClass AboutForm
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose()Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AboutForm))
Me.AlarmLabel = New System.Windows.Forms.Label
Me.SystemInfoButton = New System.Windows.Forms.Button
Me.OKButton = New System.Windows.Forms.Button
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.DescriptionTextBox = New System.Windows.Forms.TextBox
Me.UserTextBox = New System.Windows.Forms.TextBox
Me.ICOPictureBox = New System.Windows.Forms.PictureBox
Me.Label3 = New System.Windows.Forms.Label
Me.AssemblyListView = New System.Windows.Forms.ListView
Me.ColumnHeader1 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader2 = New System.Windows.Forms.ColumnHeader
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.ProductLabel = New System.Windows.Forms.Label
Me.ImagePictureBox = New System.Windows.Forms.PictureBox
CType(Me.ICOPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ImagePictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'AlarmLabel
'
Me.AlarmLabel.Location = New System.Drawing.Point(16, 294)
Me.AlarmLabel.Name = "AlarmLabel"
Me.AlarmLabel.Size = New System.Drawing.Size(368, 64)
Me.AlarmLabel.TabIndex = 27
Me.AlarmLabel.Text = "警告:本计算机程序受版权法和国际条约保护。如未经授权而擅自复制或传播本程序(或其中任何部分),将受到严厉的民事和刑事制裁,并将在法律许可的最大限度内受到起诉。"
'
'SystemInfoButton
'
Me.SystemInfoButton.Location = New System.Drawing.Point(408, 326)
Me.SystemInfoButton.Name = "SystemInfoButton"
Me.SystemInfoButton.Size = New System.Drawing.Size(104, 24)
Me.SystemInfoButton.TabIndex = 26
Me.SystemInfoButton.Text = "系统信息(&S)"
'
'OKButton
'
Me.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK
Me.OKButton.Location = New System.Drawing.Point(408, 294)
Me.OKButton.Name = "OKButton"
Me.OKButton.Size = New System.Drawing.Size(104, 24)
Me.OKButton.TabIndex = 25
Me.OKButton.Text = "确定"
'
'GroupBox1
'
Me.GroupBox1.Location = New System.Drawing.Point(8, 278)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(504, 8)
Me.GroupBox1.TabIndex = 24
Me.GroupBox1.TabStop = False
'
'DescriptionTextBox
'
Me.DescriptionTextBox.Location = New System.Drawing.Point(160, 238)
Me.DescriptionTextBox.Multiline = True
Me.DescriptionTextBox.Name = "DescriptionTextBox"
Me.DescriptionTextBox.ReadOnly = True
Me.DescriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.DescriptionTextBox.Size = New System.Drawing.Size(352, 40)
Me.DescriptionTextBox.TabIndex = 23
'
'UserTextBox
'
Me.UserTextBox.BackColor = System.Drawing.SystemColors.Control
Me.UserTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.UserTextBox.Enabled = False
Me.UserTextBox.Location = New System.Drawing.Point(104, 74)
Me.UserTextBox.Multiline = True
Me.UserTextBox.Name = "UserTextBox"
Me.UserTextBox.ReadOnly = True
Me.UserTextBox.Size = New System.Drawing.Size(400, 32)
Me.UserTextBox.TabIndex = 18
'
'ICOPictureBox
'
Me.ICOPictureBox.Location = New System.Drawing.Point(104, 238)
Me.ICOPictureBox.Name = "ICOPictureBox"
Me.ICOPictureBox.Size = New System.Drawing.Size(40, 32)
Me.ICOPictureBox.TabIndex = 22
Me.ICOPictureBox.TabStop = False
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(104, 214)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(96, 16)
Me.Label3.TabIndex = 21
Me.Label3.Text = "产品详细信息:"
'
'AssemblyListView
'
Me.AssemblyListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2})
Me.AssemblyListView.Location = New System.Drawing.Point(104, 126)
Me.AssemblyListView.Name = "AssemblyListView"
Me.AssemblyListView.Size = New System.Drawing.Size(400, 80)
Me.AssemblyListView.TabIndex = 20
Me.AssemblyListView.UseCompatibleStateImageBehavior = False
Me.AssemblyListView.View = System.Windows.Forms.View.Details
'
'ColumnHeader1
'
Me.ColumnHeader1.Text = "项目"
Me.ColumnHeader1.Width = 209
'
'ColumnHeader2
'
Me.ColumnHeader2.Text = "版本"
Me.ColumnHeader2.Width = 168
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(104, 110)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(120, 16)
Me.Label2.TabIndex = 19
Me.Label2.Text = "引用程序集:"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(104, 58)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(168, 16)
Me.Label1.TabIndex = 17
Me.Label1.Text = "本产品使用权属于:"
'
'ProductLabel
'
Me.ProductLabel.Location = New System.Drawing.Point(104, 14)
Me.ProductLabel.Name = "ProductLabel"
Me.ProductLabel.Size = New System.Drawing.Size(400, 40)
Me.ProductLabel.TabIndex = 16
'
'ImagePictureBox
'
Me.ImagePictureBox.Image = CType(resources.GetObject("ImagePictureBox.Image"), System.Drawing.Image)
Me.ImagePictureBox.Location = New System.Drawing.Point(8, 6)
Me.ImagePictureBox.Name = "ImagePictureBox"
Me.ImagePictureBox.Size = New System.Drawing.Size(88, 272)
Me.ImagePictureBox.TabIndex = 15
Me.ImagePictureBox.TabStop = False
'
'AboutForm
'
Me.AcceptButton = Me.OKButton
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.OKButton
Me.ClientSize = New System.Drawing.Size(520, 365)
Me.Controls.Add(Me.AlarmLabel)
Me.Controls.Add(Me.SystemInfoButton)
Me.Controls.Add(Me.OKButton)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.DescriptionTextBox)
Me.Controls.Add(Me.UserTextBox)
Me.Controls.Add(Me.ICOPictureBox)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.AssemblyListView)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ProductLabel)
Me.Controls.Add(Me.ImagePictureBox)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "AboutForm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "AboutForm"
CType(Me.ICOPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.ImagePictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader2 As
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class AboutFormClass AboutForm
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose()Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AboutForm))
Me.AlarmLabel = New System.Windows.Forms.Label
Me.SystemInfoButton = New System.Windows.Forms.Button
Me.OKButton = New System.Windows.Forms.Button
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.DescriptionTextBox = New System.Windows.Forms.TextBox
Me.UserTextBox = New System.Windows.Forms.TextBox
Me.ICOPictureBox = New System.Windows.Forms.PictureBox
Me.Label3 = New System.Windows.Forms.Label
Me.AssemblyListView = New System.Windows.Forms.ListView
Me.ColumnHeader1 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader2 = New System.Windows.Forms.ColumnHeader
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.ProductLabel = New System.Windows.Forms.Label
Me.ImagePictureBox = New System.Windows.Forms.PictureBox
CType(Me.ICOPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ImagePictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'AlarmLabel
'
Me.AlarmLabel.Location = New System.Drawing.Point(16, 294)
Me.AlarmLabel.Name = "AlarmLabel"
Me.AlarmLabel.Size = New System.Drawing.Size(368, 64)
Me.AlarmLabel.TabIndex = 27
Me.AlarmLabel.Text = "警告:本计算机程序受版权法和国际条约保护。如未经授权而擅自复制或传播本程序(或其中任何部分),将受到严厉的民事和刑事制裁,并将在法律许可的最大限度内受到起诉。"
'
'SystemInfoButton
'
Me.SystemInfoButton.Location = New System.Drawing.Point(408, 326)
Me.SystemInfoButton.Name = "SystemInfoButton"
Me.SystemInfoButton.Size = New System.Drawing.Size(104, 24)
Me.SystemInfoButton.TabIndex = 26
Me.SystemInfoButton.Text = "系统信息(&S)"
'
'OKButton
'
Me.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK
Me.OKButton.Location = New System.Drawing.Point(408, 294)
Me.OKButton.Name = "OKButton"
Me.OKButton.Size = New System.Drawing.Size(104, 24)
Me.OKButton.TabIndex = 25
Me.OKButton.Text = "确定"
'
'GroupBox1
'
Me.GroupBox1.Location = New System.Drawing.Point(8, 278)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(504, 8)
Me.GroupBox1.TabIndex = 24
Me.GroupBox1.TabStop = False
'
'DescriptionTextBox
'
Me.DescriptionTextBox.Location = New System.Drawing.Point(160, 238)
Me.DescriptionTextBox.Multiline = True
Me.DescriptionTextBox.Name = "DescriptionTextBox"
Me.DescriptionTextBox.ReadOnly = True
Me.DescriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.DescriptionTextBox.Size = New System.Drawing.Size(352, 40)
Me.DescriptionTextBox.TabIndex = 23
'
'UserTextBox
'
Me.UserTextBox.BackColor = System.Drawing.SystemColors.Control
Me.UserTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.UserTextBox.Enabled = False
Me.UserTextBox.Location = New System.Drawing.Point(104, 74)
Me.UserTextBox.Multiline = True
Me.UserTextBox.Name = "UserTextBox"
Me.UserTextBox.ReadOnly = True
Me.UserTextBox.Size = New System.Drawing.Size(400, 32)
Me.UserTextBox.TabIndex = 18
'
'ICOPictureBox
'
Me.ICOPictureBox.Location = New System.Drawing.Point(104, 238)
Me.ICOPictureBox.Name = "ICOPictureBox"
Me.ICOPictureBox.Size = New System.Drawing.Size(40, 32)
Me.ICOPictureBox.TabIndex = 22
Me.ICOPictureBox.TabStop = False
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(104, 214)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(96, 16)
Me.Label3.TabIndex = 21
Me.Label3.Text = "产品详细信息:"
'
'AssemblyListView
'
Me.AssemblyListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2})
Me.AssemblyListView.Location = New System.Drawing.Point(104, 126)
Me.AssemblyListView.Name = "AssemblyListView"
Me.AssemblyListView.Size = New System.Drawing.Size(400, 80)
Me.AssemblyListView.TabIndex = 20
Me.AssemblyListView.UseCompatibleStateImageBehavior = False
Me.AssemblyListView.View = System.Windows.Forms.View.Details
'
'ColumnHeader1
'
Me.ColumnHeader1.Text = "项目"
Me.ColumnHeader1.Width = 209
'
'ColumnHeader2
'
Me.ColumnHeader2.Text = "版本"
Me.ColumnHeader2.Width = 168
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(104, 110)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(120, 16)
Me.Label2.TabIndex = 19
Me.Label2.Text = "引用程序集:"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(104, 58)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(168, 16)
Me.Label1.TabIndex = 17
Me.Label1.Text = "本产品使用权属于:"
'
'ProductLabel
'
Me.ProductLabel.Location = New System.Drawing.Point(104, 14)
Me.ProductLabel.Name = "ProductLabel"
Me.ProductLabel.Size = New System.Drawing.Size(400, 40)
Me.ProductLabel.TabIndex = 16
'
'ImagePictureBox
'
Me.ImagePictureBox.Image = CType(resources.GetObject("ImagePictureBox.Image"), System.Drawing.Image)
Me.ImagePictureBox.Location = New System.Drawing.Point(8, 6)
Me.ImagePictureBox.Name = "ImagePictureBox"
Me.ImagePictureBox.Size = New System.Drawing.Size(88, 272)
Me.ImagePictureBox.TabIndex = 15
Me.ImagePictureBox.TabStop = False
'
'AboutForm
'
Me.AcceptButton = Me.OKButton
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.OKButton
Me.ClientSize = New System.Drawing.Size(520, 365)
Me.Controls.Add(Me.AlarmLabel)
Me.Controls.Add(Me.SystemInfoButton)
Me.Controls.Add(Me.OKButton)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.DescriptionTextBox)
Me.Controls.Add(Me.UserTextBox)
Me.Controls.Add(Me.ICOPictureBox)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.AssemblyListView)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ProductLabel)
Me.Controls.Add(Me.ImagePictureBox)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "AboutForm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "AboutForm"
CType(Me.ICOPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.ImagePictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader2 As