WinForm设计之About窗体

来源:岁月联盟 编辑:zhuzhu 时间:2007-01-16

Author:水如烟  

代码见应用类代码和辅助类代码

关于About窗体,已经在这做过。现在结合这段时间设计的类,重新组织一下。
这个About窗体附加了一些功能:
一是置主窗体的Text值为程序集信息Title值;二是让程序每十分钟强制垃圾回收。

设计时的主窗体:

主窗体代码:

Imports lzmtw.uSystem.uWindows.uForms

Public Class MainForm

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim m As New LzmTW.uSystem.uWindows.uForms.uMainForm.Menu.MenuManager()

        '取主窗体MenuStrip,如没有自动添加一个给它
        m.SetMainFormMenuStrip(Me)

        '读菜单文件
        m.ReadFile("Test.mnu")

        '绑定默认的Click事件
        m.AddDefaultClickHandler()

        '附加About窗体
        LzmTW.uSystem.uWindows.uForms.uMainForm.AboutFormAddtoMainForm.Instance(Me)
    End Sub

    Protected Overridable Sub OnNewClick(ByVal sender As System.Object, ByVal e As System.EventArgs) ' New
        MsgBox("New")

    End Sub

    Protected Overridable Sub OnOpenClick(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Open
        MsgBox("Open")

    End Sub

    Protected Overridable Sub OnCloseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Close
        MsgBox("Close")

    End Sub

    Protected Overridable Sub OnConfigClick(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Config
        MsgBox("Config")

    End Sub

End Class

程序集信息:

效果:

到了这里,我计划要说的也差不多了,就差SplashForm和插件了。