走近VB.Net(十一) 随心所欲窗体外观(skin精彩…

2008-04-10 03:08:11来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

Genie.LanguageID = &H409S ''''设定语音ID

Call SkinRegion(form1) ''''为窗体改变skin(外观)

End Sub

Overloads Sub new(ByVal strImage As String)

MyBase.New() ''''直接调用父类的new过程

Form1 = Me ''''设定me关键字

InitializeComponent() ''''下面是初始化组件,你也可以在下面使用call方法呼叫一个子过程(见前面的文章)

lbExit.Visible = False : lbShow.Visible = False : lbpre.Visible = False : label3.Visible = False ''''新窗体不显示控制

Me.top = Me.top 150 ''''新窗体的位置,top是距离屏幕顶部的高度

Call SkinRegion(form1, strImage) ''''为窗体改变skin(外观)

End Sub

''''上面使用overloads定义了两个不同的new过程,在new过程中使用重载可以间接地使一个类产生很好的可重用性,如果你不明白为什么不写一个新的过程,而一定要使用重载

''''那么你看看这里的用法,一定会有所启发的。

Public Overrides Sub Dispose() ''''释放资源,终止程序

MyBase.Dispose() ''''调用父类的方法

Region1.Dispose() ''''释放GDI资源

genie = Nothing ''''释放动画占用的资源

components.Dispose() ''''释放组件占用的资源

End Sub

''''下面的是非编辑模块,就不用看了

#Region " Windows Form Designer generated code "

''''Required by the Windows Form Designer

Private components As System.ComponentModel.Container

Private WithEvents lbShow As System.WinForms.Label

Private WithEvents Label3 As System.WinForms.Label

Private WithEvents LinkLabel3 As System.WinForms.LinkLabel

Private WithEvents lbExit As System.WinForms.Label

Private WithEvents lbpre As System.WinForms.Label

Private WithEvents AxAgent1 As AxAgentObjects.AxAgent

Dim WithEvents Form1 As System.WinForms.Form

''''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.

Private Sub InitializeComponent()

Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))

Me.components = New System.ComponentModel.Container()

Me.lbpre = New System.WinForms.Label()

Me.lbShow = New System.WinForms.Label()

Me.Label3 = New System.WinForms.Label()

Me.AxAgent1 = New AxAgentObjects.AxAgent()

Me.LinkLabel3 = New System.WinForms.LinkLabel()

Me.lbExit = New System.WinForms.Label()

AxAgent1.BeginInit()

''''@design Me.TrayHeight = 90

''''@design Me.TrayLargeIcon = False

''''@design Me.TrayAutoArrange = True

lbpre.Location = New System.Drawing.Point(32, 72)

lbpre.Text = "窗体"

lbpre.Size = New System.Drawing.Size(64, 24)

lbpre.TabIndex = 10

lbpre.BackColor = System.Drawing.SystemColors.Desktop

lbpre.TextAlign = System.WinForms.HorizontalAlignment.Center

lbShow.Location = New System.Drawing.Point(32, 24)

lbShow.Text = "动画"

lbShow.Size = New System.Drawing.Size(64, 24)

lbShow.TabIndex = 17

lbShow.BackColor = System.Drawing.SystemColors.Desktop

lbShow.TextAlign = System.WinForms.HorizontalAlignment.Center

Label3.Location = New System.Drawing.Point(176, 16)

Label3.Text = " "

Label3.Size = New System.Drawing.Size(176, 88)

Label3.BorderStyle = System.WinForms.BorderStyle.Fixed3D

Label3.TabIndex = 16

AxAgent1.Size = New System.Drawing.Size(56, 40)

AxAgent1.OcxState = CType(resources.GetObject("AxAgent1.OcxState"), System.WinForms.AxHost.State)

AxAgent1.TabIndex = 1

AxAgent1.Location = New System.Drawing.Point(232, 216)

LinkLabel3.Text = "LinkLabel3"

LinkLabel3.Size = New System.Drawing.Size(0, 16)

LinkLabel3.TabIndex = 15

LinkLabel3.TabStop = True

LinkLabel3.Location = New System.Drawing.Point(352, 88)

lbExit.Location = New System.Drawing.Point(32, 48)

lbExit.Text = "退出"

lbExit.Size = New System.Drawing.Size(64, 24)

lbExit.TabIndex = 11

lbExit.BackColor = System.Drawing.SystemColors.Desktop

lbExit.TextAlign = System.WinForms.HorizontalAlignment.Center

Me.Text = "Form1"

Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)

Me.BorderStyle = System.WinForms.FormBorderStyle.None

Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:走近VB.Net(十) 播放声音文件

下一篇:用VISUAL BASIC5.0创建Active