自制进度条控件(vb)
一个用VB编写ActiveX自定义控件的例子——进度条控件

一个用VB编写ActiveX自定义控件的例子——进度条控件设计方法:1.在UserControl中添加一个Label控件Label1,将它设为平面,用来做外框。
添加两个PictureBox控件PictureBox1做为进度指示,PictureBox2控件做为控件背景。
2.加入以下代码Option Explicit''定义私有变量用于存储属性值Private mvarMax As LongPrivate mvarMin As LongPrivate mvarValue As LongPrivate Rate As StringPrivate Sub UserControl_Initialize()''初始化Picture2.BackColor = vbBlueEnd SubPublic Property Get BackColor() As OLE_COLOR''读取BackColor属性BackColor = Picture1.BackColorEnd PropertyPublic Property Let BackColor(ByVal vNewValue As OLE_COLOR)''设置BackColor属性Picture1.BackColor = vNewValueEnd PropertyPrivate Sub UserControl_InitProperties()''初始化属性Max = 100Min = 0Value = 0End SubPrivate Sub UserControl_ReadProperties(PropBag As PropertyBag)''读取从属性窗体中设置的属性值mvarMax = PropBag.ReadProperty("Max", 100)mvarMin = PropBag.R eadProperty("Min", 0)''Value属性值这里未提供,主要是模仿VB自带的进度条控件''mvarValue = PropBag.R eadProperty("Value", 0)End SubPrivate Sub UserControl_WriteProperties(PropBag As PropertyBag)''保存从属性窗体中设置的属性值PropBag.WriteProperty "Max", mvarMax, 100PropBag.WriteProperty "Min", mvarMin, 0''PropBag.WriteProperty "Value", mvarValue, 0End SubPrivate Sub UserControl_Resize()''R esize事件Label1.Move 0, 0, UserControl.Width / Screen.TwipsPerPixelX, UserControl.Height / Screen.TwipsPerPixel YPicture1.Move 1, 1, UserControl.Width / Screen.TwipsPerPixelX - 2, UserControl.Height / Screen.TwipsPerPixel Y - 2Picture2.Move 1, 1, 1, UserControl.Height / Screen.TwipsPerPixelY - 2End SubPublic Property Get Max() As Long''读取Max属性Max = mvarMaxEnd PropertyPublic Property Let Max(ByVal vNewValue As Long)''设置Max属性mvarMax = vNewValueIf vNewValue < Min Then Err.Raise "1001", , "Max必须大于Min"End PropertyPublic Property Get Min() As Long''读取Min属性Min = mvarMinEnd PropertyPublic Property Let Min(ByVal vNewValue As Long)''设置Min属性If vNewValue > Max Then Err.Raise "1000", , "Min必须小于Max"mvarMin = vNewValueEnd PropertyPublic Property Get Value() As Long''读取Value属性Value = mvarValueEnd PropertyPublic Property Let Value(ByVal vNewValue As Long)''设置Value属性''原理就是在两个PictureBox中以不同颜色打印百分比进度Dim DX As Long, DY As LongIf vNewValue > Max Then Err.Raise "1002", , "Value不能大于Max"mvarValue = vNewValuePicture2.Width = Value / (Max - Min) * (UserControl.Width / Screen.TwipsPerPixelX - 2) Rate = Int(Value / (Max - Min) * 100) & "%"DX = (Picture1.Width - Picture1.TextWidth(Rate)) / 2DY = (Picture1.Height - Picture1.TextHeight(Rate)) / 2Picture1.ForeColor = vbBlackPicture2.ForeColor = vbWhi t eIf DX < Picture2.Width ThenPicture2.ClsPicture2.CurrentX = DXPicture2.CurrentY = DYPicture2.Print RateElsePicture1.ClsPicture1.CurrentX = DXPicture1.CurrentY = DYPicture1.Print RateEnd IfEnd Property3.新建另一个测试工程,加入一个自己的进度条控件和一个系统的进度条控件,加入以下代码:Option ExplicitPrivate Sub Command1_Click()Unload MeEnd SubPrivate Sub Timer1_Timer()myProgressBar1.Value = myProgressBar1.Value + 2ProgressBar1.Value = ProgressBar1.Value + 2If myProgressBar1.Value = myProgressBar1.Max Then Timer1.Enabled = FalseEnd Sub。
VBA实战技巧30:创建自定义的进度条1

VBA实战技巧30:创建⾃定义的进度条1excelperfect宏是Excel中最好的⼯具之⼀,可以让我们节省时间。
使⽤VBA宏,可以⾃动执⾏重复、单调且有时⾮常⽆聊的任务。
在某些情况下,这有可能将数⼩时的⼯作减少到⼏分钟或⼏秒钟。
但并⾮所有宏都可以实现此类性能要求,有时候数据实在太庞⼤了,电脑只能运⾏这么快。
在极端情况下,任务可能进展得极其缓慢,以致我们认为系统可能已锁定或崩溃。
因此,发明了进度条。
在Windows的早期,机器被认为是缓慢且容易崩溃的。
通过向⽤户提供进度的视觉指⽰器,我们知道系统仍在⼯作,并且可以合理猜测任务何时完成。
在宏执⾏可能需要相当长时间的情况下,为⽤户提供进度条是⼀个不错的选择。
本⽂所介绍的进度条创建过程代码可以⽤于其他任务中,⽰例中,我们的⾃动化过程将遍历表中的记录,在每条记录处暂停1/10秒。
1.设置可视化界⾯使⽤VBA的⽤户窗体创建进度条。
⾸先,在VBE中,单击“插⼊——⽤户窗体”,结果如下图1所⽰。
图1重新命名该窗体名称为“UserForm_v1”,标题为“创建PDF⽂档”,如下图2所⽰。
图2在窗体中:插⼊⼀个标签并设置合适的标题;插⼊⼀幅图像;插⼊⼀个框架,⽤作滚动条的边框并显⽰数字百分⽐计数器。
将其标题设置为“0%”,这将在代码执⾏期间更改为读取进度百分⽐。
在框架内,插⼊另⼀个标签,该标签将不包含⽂本,⽽是充当滚动条。
这是通过为标签内部着⾊并逐渐调整其⼤⼩来执⾏的,随着宏的执⾏,它会越来越⼤。
标签的属性可能是:BackColor– &H00C00000& (蓝⾊),BackStyle –1-fmBackStyleOpaque,BorderColor–&H80000006& (灰⾊),Height – 30,SpecialEffect –1-fmSpecialEffectRaised,Width –18。
结果如下图3所⽰。
图32.编写⽤户窗体代码双击⽤户窗体进⼊其代码模块,在UserForm_Activate事件中,输⼊代码。
VB进度条的编写

VB进度条制作方法VB ProgressBar控件进度条:Private Sub Command1_Click()Dim counter As IntegerDim workarea(25000) As StringProgressBar1.Min = LBound(workarea)ProgressBar1.Max = UBound(workarea)ProgressBar1.Visible = TrueProgressBar1.Value = ProgressBar1.MinFor counter = LBound(workarea) To UBound(workarea)workarea(counter) = "initial value" & counterProgressBar1.Value = counterNext counterEnd Sub各位看官,直接看下面:TEXT控件进度条:Option ExplicitDim i As IntegerPrivate Sub Form_Load()Timer1.Enabled = TrueText2.Width = (Form1.Width / 100)End SubPrivate Sub Timer1_Timer()'进度条设置Text2.Width = Text2.Width + (Form1.Width / 100)If (Text2.Width / Form1.Width) > 1 ThenForm2.Show '载入主画面Unload MeEnd IfEnd SubLmage控件进度条:Option ExplicitDim i As IntegerPrivate Sub Form_Load()JDT.Top = Lab.TopJDT.Width = (Lab.Width / 100)End SubPrivate Sub Timer1_Timer()'进度条设置JDT.Width = JDT.Width + (Lab.Width / 100)If (JDT.Width / Lab.Width) > 1 ThenForm1.Show '载入主画面Unload MeEnd IfEnd SubPicture控件进度条:'例子需以下控件: 'Command1、Command2、Picture1:都采用默认属性设置Dim ctEsc As BooleanPrivate Sub Form_Load()'初始化控件Picture1.AutoRedraw = TrueCommand1.Caption = "滚动条例子": Command2.Caption = "取消"End SubPrivate Sub Command1_Click()Dim I As Long, S As LongctEsc = FalseS = 1000For I = 1 To SMe.Cls: Me.Print "显示:" & IJinDuTiao I / S, "0.0" '显示进度条:进度,显示格式(即小数数位)DoEventsIf ctEsc Then Me.Print "已取消": Exit SubNextMe.Print "完毕"End SubPrivate Sub Command2_Click()ctEsc = TrueEnd SubPrivate Sub JinDuTiao(Bi As Single, Optional nFormt As String = "0")Dim W As Long, H As Long, nStr As StringStatic UpBi As StringnStr = Format(Bi * 100, nFormt)If Val(nStr) >= "100" Then nStr = 100If UpBi = nStr Then Exit SubUpBi = nStrW = Picture1.ScaleWidth: H = Picture1.ScaleHeightPicture1.ClsPicture1.DrawMode = 13nStr = nStr & " %"Picture1.CurrentX = (W - Picture1.TextWidth(nStr)) * 0.5Picture1.CurrentY = (H - Picture1.TextHeight(nStr)) * 0.5Picture1.Print nStrPicture1.DrawMode = 14Picture1.Line (0, 0)-(W * Bi, H), &HFF0000, BFPicture1.RefreshEnd SubShape控件进度条:需要用到的控件: 'Command1、Command2、Label1、Label2、Shape1Dim ctEsc As BooleanPrivate Sub Form_Load()'初始化控件Command1.Caption = "滚动条例子": Command2.Caption = "取消"Label1.BorderStyle = 1: Label1.Caption = "0%"Label1.Alignment = 2: Label1.Height = Me.TextHeight("A") * 1.5Shape1.FillStyle = 0: Shape1.FillColor = &HFF0000: Shape1.DrawMode = 14Shape1.Move Label1.Left, Label1.Top, 30, Label1.Height - Screen.TwipsPerPixelY * 2Shape1.ZOrderEnd SubPrivate Sub Command1_Click()Dim I As Long, S As LongctEsc = FalseS = 1000For I = 1 To SMe.Cls: Me.Print "显示:" & IJinDuTiao I / S, "0.0" '显示进度条:进度,显示格式(即小数数位)DoEventsIf ctEsc Then Me.Print "已取消": Exit SubNextMe.Print "完毕"End SubPrivate Sub Command2_Click()ctEsc = TrueEnd SubPrivate Sub JinDuTiao(Bi As Single, Optional nFormt As String = "0")Label1.Caption = Int(Bi * 100) & "%"Shape1.Width = Bi * Label1.WidthEnd Sub。
VB中打造个性进度条

简介UpsUpsVB的第三方控件ccrpProgressBar是一个进度条的控件,可以有多种形态供选择。
比起VB 中自带的进度条控件ProgressBar更有个性。
UpsUps使用实例:UpsUps用ccrpProgressBar制作各式各样的进度条UpsUps在VB中自带了一个进度条控件ProgressBar,但功能简单。
我向大家推荐一个VB的第三方进度条控件ccrpProgressBar。
该控件功能强大,有多种形态供选择,而且只需要简单的设置控件的属性就能实现,非常的好用。
下面通过一个例子向大家介绍该控件的用法。
UpsUps(1)加载控件UpsUps启动Visual Basic 6.0,创建一个工程并保存为"工程1.vbp",同时产生一个名为"Form1"的窗口。
在工具箱的空白处单击鼠标右键,从弹出的快捷菜单中启动"部件"窗口,如图1所示。
UpsUpsUps图1Ups点击"浏览"按钮,从存放ccrpProgressBar控件的文件夹中找到ccrpprg.o cx文件。
UpsUps点击"应用"后ccrpProgressBar控件就添加到工具箱中。
如图2。
Ups UpsUps图2Ups(2)设计窗体和控件UpsUps向窗体中添加9个ccrpProgressBar控件和一个Timer控件。
如图3。
Ups UpsUps图3Timer控件属性页的设置如图4所示。
Interval的值设置为100,与ccrpP rogressBar控件的默认值一致。
Enabled设置为False。
UpsUpsUps图4Ups(3) ccrpProgressBar控件的主要属性UpsUps·Max:最大值。
默认100。
Ups·Min:最小值。
默认0。
Ups·Value:进度条的当前值。
Ups·Alig nment:显示表示进度的文字的位置。
VB编写进度条

VB 编写进度条已经发展很久了,也有很多好方法。
VB 自带的进度条很难看,一般不用,要用的话,代码如下:Private Sub Command1_Click() Dim counter As Integer Dim workarea(25000) As String ProgressBar1.Min = LBound(workarea) ProgressBar1.Max = UBound(workarea) ProgressBar1.Visible = TrueProgressBar1.Value = ProgressBar1.Min For counter = LBound(workarea) To UBound(workarea)workarea(counter) = "initial value" & counter ProgressBar1.Value = counter Next counter End Sub各位看官,直接看下面:Text 实现进度条:Option Explicit Dim i As IntegerPrivate Sub Form_Load() Timer1.Enabled = TrueText2.Width = (Form1.Width / 100) End SubPrivate Sub Timer1_Timer() '进度条设置Text2.Width = Text2.Width + (Form1.Width / 100) If (Text2.Width / Form1.Width) > 1 Then Form2.Show '载入主画面 Unload Me End If End SubImage 进度条:Option Explicit Dim i As IntegerPrivate Sub Form_Load()JDT.Top = Lab.TopJDT.Width = (Lab.Width / 100) End SubPrivate Sub Timer1_Timer() '进度条设置JDT.Width = JDT.Width + (Lab.Width / 100) If (JDT.Width / Lab.Width) > 1 Then Form1.Show '载入主画面 Unload Me End If End Sub那么更换N 个image 就会有N 个进度条演示,下面示图,大家自己试试。
VBA窗体之进度条VBA实例教程

VBA窗体之进度条VBA实例教程在程序需要运⾏较长时间时加上⼀个进度条可能会显得更加⾼⼤上⼀些,这节我们来看下怎样制作进度条,这⾥介绍两种⽅法,⼀种是⽤标签控件结合⽂本框来实现进度条效果,⼀种是直接利⽤VBA的进度条控件。
下⾯来看第⼀种⽅法,其思路是以⼀个⽂本框做为⽩⾊背景,以⼀个标签控件覆盖于⽂本框之上,随着程序的运⾏不断调整标签控件的宽度来覆盖⽂本框就有了进度条的效果。
在这⾥我⼜在⽂本框的中间加了⼀个标签来以数字形式显⽰进度。
Private Sub CommandButton1_Click()Dim i, w, k, nw = TextBox1.Width '⽂本框的宽度n = 10000 '运⾏的步数For i = 1 To nk = k + w / n '标签的宽度Label1.Width = kLabel2.Caption = Format(i / n, "0.00%")DoEvents '有这句才会实时显⽰标签变化NextMsgBox "完成"End Sub上⾯就是⼀个简单的数学问题,总进程长度是⽂本框的长度w,总步数为n,则每运⾏⼀步标签控件长度需增加w/n。
需要提前在属性窗⼝设置好Lable1的颜⾊,⽂本框的Enable属性要设成False,否则运⾏之前⽂本框会有个光标在闪,Lable2的BackStyle要选0,即透明,否则就把⽂本框遮住了。
上⾯是第⼀种⽅法第⼆种⽅法是直接利⽤VBA的进度条控件。
初始的话⼯具窗中⼀般不显⽰,需要在附加控件中勾选“Microsoft ProgressBar Control”。
Private Sub CommandButton1_Click()Dim i, nn = 10000ProgressBar1.Max = nProgressBar1.Min = 0For i = 0 To nProgressBar1.Value = iNextMsgBox "完成"End Sub这个⽤起来就简单了,分别设置进度条的最⼤值为总步数、最⼩值为0,运⾏到哪⼀步就直接使Value等于该值即可,没啥好说的了。
VBA模拟进度条

VBA模拟进度条
昨天审凭证的时候突然冒出个奇怪的想法,就是想做一个VBA进度条,因为我平时处理的表很多是集团的,工作表很多,数据量很大,如果有进度条,等待的过程会充满了人机交互的乐趣!
于是上百度,搜“VBA进度条”,找到了一个DEMO。
马上改装移植到我的各地费用表中。
首先做一个进度条的窗体,窗体中包括四个Label,格式需要设置一下。
然后是控制代码:
With UserForm1
.Show 0
FOR i=1 TO n
...
.Label3.Width = Int(i / n * 285)
.Label4.Caption = CStr(Int(i / n * 100)) + "%"
.Caption = "正在计算:" & ThisWorkbook.Sheets("部门").Range("B" & i).Value & "......"根据实际情况改一下显示内容DoEvents
next i
End With
Unload UserForm1
下面是效果图:。
vb实现进度条

vb实现进度条'点击系统菜单“工具”->“选项”,调出选项对话匡后选择“控件”页,再选择ActiveX控件,选定列表栏里的Microsoft ProgressBar Control控件,'一般里面有两个版本的,分别是V5.0(SP2)和v6.0。
建议用V5.0(SP2)版的,这个控件的风格可以根据WIN的主题风格的变化而变化,而V6.0是固定的一个格子'一个格子的跳。
选定后,前面的小匡内会有个‘X’,点确定。
Dim A As DoubleDim B As DoubleDim C As DoubleDim DDim p As SingleProgressBar1.Min = 0ProgressBar1.Max = 1000ProgressBar1.Value = ProgressBar1.MinProgressBar1.Scrolling = ccScrollingSmooth' 定义进度条最小值,最大值,当前进度和样式Dim Mx As LongMx = 1000000For A = 1 To MxFor B = 1 To 10000000C = B + ANext BIf A Mod (Mx / ProgressBar1.Max) = 1 Then ' 不需要每次都做, 只要进行到某个时候做一次就好了.' 计算出当前进度ProgressBar1.Value = A * ProgressBar1.Max \ MxDoEventsEnd IfNext AProgressBar1.Value = ProgressBar1.Max ' 最后, 进度=进度条最大值.MsgBox C。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
'功能:自制作控件完成保存图片进度显示'说明:1.PropertyChanged "属性名":此代码告诉属性窗口刷新其显示内容,并通知VB窗体已经改变' 2.要把picProgress.AutoRedraw=TrueOption Explicit'声明变量Dim sCaption As String '控件标题Dim lMaxValue As Long '进度条最大长度值Dim lMinValue As Long '进度条起始长度值Dim lValue As Long&n bsp; '进度条当前长度值Dim oFillColor As OLE_COLOR '填充色Dim m_CaptionStyle As Integer '标题风格'重新定义各种事件'Event Click()'定义枚举类型Public Enum eBorderStyle '进度条边框无边框 = 0有边框End EnumPublic Enum eCaptionStyleeCap_None = 0 '不显示标题与%eCap_CaptionOnly '只显示标题eCap_PercentOnly '只显示%eCap_CaptionPercent '显示标题与%End EnumPublic Enum eAppearance '进度条显示样式平面 = 0立体End Enum'功能:初始化'说明:Private Sub UserControl_Initialize()End Sub'功能:为每个控件初始化缺省属性'说明:当一个控件被添加到窗体中时,此事件被触发Private Sub UserControl_InitProperties()Max = 100Min = 0BackColor = UserControl.BackColorFillColor = vbBlueCaptionStyle = eCap_PercentOnly' SyncLabelFontsEnd Sub'功能:读属性读取控件的属性设置值,从而在VB的按钮属性设置窗口显示'入口参数:1.读取属性,由VB提供' 2.ReadProperty:参数1---属性名参数2---缺省值' 3.当没有保存过任何值或用户已从文本中删除保存的属性时,将读取这个缺省值'出口参数:无'说明:相当于Load事件在读取CaptionFont 属性时会出错,用On Error Resume Next屏蔽Private Sub UserControl_ReadProperties(PropBag As PropertyBag)On Error Resume NextAppearance = PropBag.ReadProperty("Appearance", picProgress.Appearance)Caption = PropBag.ReadProperty("Caption", "")ForeColor = PropBag.ReadProperty("ForeColor", picProgress.ForeColor)BackColor = PropBag.ReadProperty("BackColor", picProgress.BackColor)FillColor = PropBag.ReadProperty("FillColor", oFillColor)BorderStyle = PropBag.ReadProperty("BorderStyle", 1)CaptionStyle = PropBag.ReadProperty("CaptionStyle", 3)Enabled = PropBag.ReadProperty("Enabled", True)Max = PropBag.ReadProperty("Max", 100)Min = PropBag.ReadProperty("Min", 0)Set CaptionFont = PropBag.ReadProperty("CaptionFont")End Sub'功能:位置调整'说明:Private Sub UserControl_Resize()picProgress.Width = UserControl.WidthpicProgress.Height = UserControl.HeightEnd Sub'功能:结束'说明:Private Sub UserControl_Terminate()End Sub'功能:写属性写回控件的属性设置值,从而将各种属性的值通过VB的按钮属性设置窗口传送给按钮'入口参数:1.保存属性,由VB提供' 2.WriteProperty:参数1---属性名(检索关键字使用) 参数2---把属性值作为一个变量保存' ; 参数3---缺省值(当属性值和该缺省值相同时,该属性值不必保存)'出口参数:无'说明:相当于Unload事件不要保存Max属性值,以便初始值为100Private Sub UserControl_WriteProperties(PropBag As PropertyBag)Call PropBag.WriteProperty("Appearance", picProgress.Appearance)Call PropBag.WriteProperty("Caption", Caption)Call PropBag.WriteProperty("ForeColor", picProgress.ForeColor)Call PropBag.WriteProperty("BackColor", picProgress.BackColor)Call PropBag.WriteProperty("FillColor", oFillColor)Call PropBag.WriteProperty("BorderStyle", BorderStyle, 1)Call PropBag.WriteProperty("CaptionStyle", CaptionStyle, 3)Call PropBag.WriteProperty("Enabled", Enabled, True)' Call PropBag.WriteProperty("Max", Max, 100)Call PropBag.WriteProperty("Min", Min, 0)Call PropBag.WriteProperty("CaptionFont", CaptionFont)End Sub'功能:取得控件的显示效果'说明:读取属性给自制控件属性Public Property Get Appearance() As eAppearanceAppearance = picProgress.AppearanceEnd Property'功能:设置控件的显示效果'说明:赋新值Public Property Let Appearance(ByVal nValue As eAppearance) picProgress.Appearance = nValuePropertyChanged "Appearance"End Property'功能:取得控件的标题'说明:Public Property Get Caption() As StringCaption = sCaptionEnd Property'功能:设置控件的标题'说明:Public Property Let Caption(ByVal nValue As String) sCaption = Trim(nValue)' Call ChangedValue(Value)PropertyChanged "Caption"End Property'功能:取得控件的前景色'说明:Public Property Get ForeColor() As OLE_COLORForeColor = picProgress.ForeColorEnd Property'功能:设置控件的前景色'说明:Public Property Let ForeColor(ByVal nValue As OLE_COLOR) picProgress.ForeColor = nValuePropertyChanged "ForeColor"End Property'功能:取得控件的背景色'说明:Public Property Get BackColor() As OLE_COLORBackColor = picProgress.BackColorEnd Property'功能:设置控件的背景色'说明:Public Property Let BackColor(ByVal nValue As OLE_COLOR) picProgress.BackColor = nValuePropertyChanged "BackColor"End Property'功能:取得进度条最大长度'说明:Public Property Get Max() As LongMax = lMaxValueEnd Property'功能:设置进度条最大长度'说明:Public Property Let Max(ByVal nValue As Long)lMaxValue = nValuePropertyChanged "Max"End Property'功能:取得进度条起始长度'说明:Public Property Get Min() As LongMin = lMinValueEnd Property'功能:设置进度条起始长度'说明:Public Property Let Min(ByVal nValue As Long)lMinValue = nValuePropertyChanged "Min"End Property'功能:取得进度条当前长度'说明:Public Property Get Value() As LongValue = lValueEnd Property'功能:设置进度条当前长度'说明:设置新长度后,进度条当前值即时更改Public Property Let Value(ByVal nValue As Long)lValue = nValueCall ChangedValue(nValue)PropertyChanged "Value"End Property'功能:取得控件的填充颜色'说明:Public Property Get FillColor() As OLE_COLORFillColor = oFillColorEnd Property'功能:设置控件的填充颜色'说明:Public Property Let FillColor(ByVal nValue As OLE_COLOR) oFillColor = nValuePropertyChanged "FillColor"End Property'功能:取得控件状态'说明:Public Property Get Enabled() As BooleanEnabled = picProgress.EnabledEnd Property'功能:设置控件状态'说明:Public Property Let Enabled(ByVal nValue As Boolean) picProgress.Enabled = nValuePropertyChanged "Enabled"End Property'功能:取得控件边框样式'说明:Public Property Get BorderStyle() As eBorderStyleBorderStyle = picProgress.BorderStyleEnd Property'功能:设置控件边框样式'说明:Public Property Let BorderStyle(ByVal nValue As eBorderStyle) picProgress.BorderStyle = nValuePropertyChanged "BorderStyle"End Property'功能:取得进度条显示风格'说明:Public Property Get CaptionStyle() As eCaptionStyle CaptionStyle = m_CaptionStyleEnd Property'功能:设置进度条显示风格'说明:Public Property Let CaptionStyle(ByVal nValue As eCaptionStyle) m_CaptionStyle = nValueCall ChangedValue(Value)PropertyChanged "CaptionStyle"End Property'功能:返回按钮的标题文字字体'说明:Public Property Get CaptionFont() As FontSet CaptionFont = UserControl.FontEnd Property'功能:设置按钮的标题文字字体'说明:此处用的Set而不是Let语句Public Property Set CaptionFont(ByVal nValue As Font)Set UserControl.Font = nValue'SyncLabelFontsPropertyChanged "CaptionFont"End Property。