aboutbox.vb
来自「Samples are organized by chapter, and th」· VB 代码 · 共 112 行
VB
112 行
Public Class AboutBox
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
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.
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents lblPath As System.Windows.Forms.Label
Friend WithEvents lblProductVersion As System.Windows.Forms.Label
Friend WithEvents lblProductName As System.Windows.Forms.Label
Friend WithEvents cmdClose As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.lblPath = New System.Windows.Forms.Label()
Me.lblProductVersion = New System.Windows.Forms.Label()
Me.lblProductName = New System.Windows.Forms.Label()
Me.cmdClose = New System.Windows.Forms.Button()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblPath, Me.lblProductVersion, Me.lblProductName})
Me.GroupBox1.Location = New System.Drawing.Point(8, 4)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(272, 148)
Me.GroupBox1.TabIndex = 3
Me.GroupBox1.TabStop = False
'
'lblPath
'
Me.lblPath.Location = New System.Drawing.Point(20, 80)
Me.lblPath.Name = "lblPath"
Me.lblPath.Size = New System.Drawing.Size(228, 40)
Me.lblPath.TabIndex = 5
'
'lblProductVersion
'
Me.lblProductVersion.Location = New System.Drawing.Point(20, 52)
Me.lblProductVersion.Name = "lblProductVersion"
Me.lblProductVersion.Size = New System.Drawing.Size(228, 16)
Me.lblProductVersion.TabIndex = 4
'
'lblProductName
'
Me.lblProductName.Location = New System.Drawing.Point(20, 24)
Me.lblProductName.Name = "lblProductName"
Me.lblProductName.Size = New System.Drawing.Size(228, 16)
Me.lblProductName.TabIndex = 3
'
'cmdClose
'
Me.cmdClose.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.cmdClose.Location = New System.Drawing.Point(104, 168)
Me.cmdClose.Name = "cmdClose"
Me.cmdClose.Size = New System.Drawing.Size(80, 28)
Me.cmdClose.TabIndex = 4
Me.cmdClose.Text = "Close"
'
'AboutBox
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 14)
Me.ClientSize = New System.Drawing.Size(292, 206)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdClose, Me.GroupBox1})
Me.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "AboutBox"
Me.Text = "Generic About Box"
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub AboutBox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblProductName.Text = Application.ProductName
lblProductVersion.Text = "Version: " & Application.ProductVersion.ToString()
lblPath.Text = "Executing in: " & Application.ExecutablePath
End Sub
Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click
Me.Close()
End Sub
End Class
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?