📄 progressbar.ctl
字号:
VERSION 5.00
Begin VB.UserControl ProgressBar
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ClientHeight = 3600
ClientLeft = 0
ClientTop = 0
ClientWidth = 4800
ScaleHeight = 3600
ScaleWidth = 4800
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "00.00%"
Height = 180
Left = 1920
TabIndex = 0
Top = 1680
Width = 540
End
End
Attribute VB_Name = "ProgressBar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Private mvarValue As Single
Public Property Let Value(ByVal vData As Single)
mvarValue = vData
Const PI As Single = 3.14159265358979
Dim i As Integer, t As Single
Static TvData As Single
If vData < TvData Then
TvData = 0
UserControl.Cls
End If
UserControl.ScaleMode = 3
For i = TvData * UserControl.ScaleWidth To vData * UserControl.ScaleWidth
t = i / UserControl.ScaleWidth
UserControl.Line (i, 0)-(i, UserControl.ScaleHeight), RGB(255 - t * 128, 255 * Sin(t * PI), t * 255)
Next
TvData = vData
Label1.Caption = Format$(vData * 100, "00.00") & "%"
End Property
Public Property Get Value() As Single
Value = mvarValue
End Property
Private Sub UserControl_Resize()
Label1.Move UserControl.Width \ 2 - Label1.Width \ 2, UserControl.Height \ 2 - Label1.Height \ 2
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -