手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网络编程>Asp.Net编程>列表

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

来源:互联网 作者:西部数码 时间:2008-04-10
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

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)

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!