LzmTW.uSystem.uWindows.uForms.uMainForm + AboutForm

 Author:水如烟  

Imports  System.Windows.Forms
Namespace  LzmTW.uSystem.uWindows.uForms.uMainForm
    
Public   Class  AboutFormAddtoMainForm
        
Private   WithEvents  gMainForm  As  Windows.Forms.Form
        
Private   WithEvents  gServerTimer  As  System.Timers.Timer

        
Sub   New ( ByVal  mainform  As  Form)

            gMainForm 
=  mainform
            Initialize()
        
End Sub

        
Private   Sub  Initialize()

            
Dim  mMenuManager  As   New  Menu.MenuManager()
            
With  mMenuManager

                .SetMainFormMenuStrip(
Me .gMainForm)

                
If  .FindToolStripItem( " Help " Is   Nothing   Then
                    .AddParentToolStripMenuItem(Menu.MenuManager.GetDefaultMenuItem(
" Help " ))
                
End   If

                
If  .FindToolStripItem( " About " Is   Nothing   Then
                    .AddToolStripMenuItem(
" Help " , Menu.MenuManager.GetDefaultMenuItem( " About " ))
                
End   If


                
With   CType (.FindToolStripItem( " About " ), ToolStripMenuItem)
                    
If  .Text.IndexOf( " {0} " <>   - 1   Then
                        .Text 
=   String .Format(.Text, EntryAssemblyInfo.Instance.Title)
                        mMenuManager.AddClickHandler(
" About " AddressOf  OnAboutClick)
                    
End   If

                
End   With

            
End   With

            
Me .gMainForm.Text  =  EntryAssemblyInfo.Instance.Title

            gServerTimer 
=   New  System.Timers.Timer( 6000 )
            gServerTimer.Start()
        
End Sub

        
Private   Sub  OnAboutClick( ByVal  sender  As  System.Object,  ByVal  e  As  System.EventArgs)
            
Using  mAbout  As   New  AboutForm
                
With  mAbout
                    .ShowDialog(gMainForm)
                
End   With
            
End   Using
        
End Sub

        
Private   Sub  gMainForm_FormClosing( ByVal  sender  As   Object ByVal  e  As  System.Windows.Forms.FormClosingEventArgs)  Handles  gMainForm.FormClosing
            
If  gServerTimer  Is   Nothing   Then   Exit Sub
            gServerTimer.Dispose()
            gServerTimer 
=   Nothing
        
End Sub

        
Private   Sub  gServerTimer_Elapsed( ByVal  sender  As   Object ByVal  e  As  System.Timers.ElapsedEventArgs)  Handles  gServerTimer.Elapsed
            GC.Collect(
2 )
        
End Sub

        
Public   Shared   Function  Instance( ByVal  mainForm  As  Form)  As  AboutFormAddtoMainForm
            
Return   New  AboutFormAddtoMainForm(mainForm)
        
End Function
    
End Class
End Namespace

 

Namespace  LzmTW.uSystem.uWindows.uForms.uMainForm
    
Friend   Class  AboutForm
        
Private  TEXT_DECLARE  As   String   =   " 关于 {0} "
        
Private  PRODUCT_DECLARE  As   String   =   " {0}  版本  {1} "   &  System.Environment.NewLine  &   " {2}.  保留所有权利 "
        
Private  AUTHORIZATION_DECLARE  As   String   =   " {0} "   &  System.Environment.NewLine  &   " {1} "

        
Private   Sub  Initialize()
            
With  EntryAssemblyInfo.Instance
                
Me .Text  =   String .Format( Me .TEXT_DECLARE, .Title)
                
Me .ProductLabel.Text  =   String .Format( Me .PRODUCT_DECLARE, .ProductName, .Version, .Copyright)
                
Me .UserTextBox.Text  =   String .Format( Me .AUTHORIZATION_DECLARE, System.Environment.UserName, System.Environment.MachineName)
                
Me .DescriptionTextBox.Text  =  .Description
            
End   With

            
For   Each  RefAsm  As  Reflection.AssemblyName  In  Reflection.Assembly.GetEntryAssembly.GetReferencedAssemblies
                
Me .AssemblyListView.Items.Add( New  System.Windows.Forms.ListViewItem( New   String () {RefAsm.Name, RefAsm.Version.ToString}))
            
Next

        
End Sub

        
Private   Sub  AddIcon( ByVal  mainform  As  Windows.Forms.Form)
            
Me .ICOPictureBox.Image  =   CType (mainform.Icon.ToBitmap, System.Drawing.Image)
        
End Sub


        
Private   Sub  SystemInfoButton_Click( ByVal  sender  As  System.Object,  ByVal  e  As  System.EventArgs)  Handles  SystemInfoButton.Click
            System.Diagnostics.Process.Start(
" MSInfo32 " )

        
End Sub

        
Public   Overloads   Sub  ShowDialog( ByVal  mainform  As  Windows.Forms.Form)
            Initialize()
            AddIcon(mainform)
            
MyBase .ShowDialog(mainform)
        
End Sub

        
< Obsolete( " 此方法停用 " ) >  _
        
Public   Overloads   Sub  Show()
            
Throw   New  Exception( " 此方法停用 " )
        
End Sub
     
    
End Class
End Namespace

 

Namespace  LzmTW.uSystem.uWindows.uForms.uMainForm
    
< Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated() >  _
    
Partial   Class  AboutForm
        
Inherits  System.Windows.Forms.Form

        
' Form overrides dispose to clean up the component list.
         < System.Diagnostics.DebuggerNonUserCode() >  _
        
Protected   Overrides   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()
            
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 .ShowInTaskbar  =   False
            
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  System.Windows.Forms.ColumnHeader
        
Protected   Friend   WithEvents  AlarmLabel  As  System.Windows.Forms.Label
        
Protected   Friend   WithEvents  OKButton  As  System.Windows.Forms.Button
        
Protected   Friend   WithEvents  GroupBox1  As  System.Windows.Forms.GroupBox
        
Protected   Friend   WithEvents  DescriptionTextBox  As  System.Windows.Forms.TextBox
        
Protected   Friend   WithEvents  UserTextBox  As  System.Windows.Forms.TextBox
        
Protected   Friend   WithEvents  ICOPictureBox  As  System.Windows.Forms.PictureBox
        
Protected   Friend   WithEvents  Label3  As  System.Windows.Forms.Label
        
Protected   Friend   WithEvents  AssemblyListView  As  System.Windows.Forms.ListView
        
Protected   Friend   WithEvents  Label2  As  System.Windows.Forms.Label
        
Protected   Friend   WithEvents  Label1  As  System.Windows.Forms.Label
        
Protected   Friend   WithEvents  ProductLabel  As  System.Windows.Forms.Label
        
Protected   Friend   WithEvents  ImagePictureBox  As  System.Windows.Forms.PictureBox
        
Protected   Friend   WithEvents  SystemInfoButton  As  System.Windows.Forms.Button
    
End Class
End Namespace

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值