home *** CD-ROM | disk | FTP | other *** search
Visual Basic user-defined control file | 1999-10-13 | 3.0 KB | 99 lines |
- VERSION 5.00
- Begin VB.UserControl Progress
- ClientHeight = 1080
- ClientLeft = 0
- ClientTop = 0
- ClientWidth = 4665
- ScaleHeight = 1080
- ScaleWidth = 4665
- Begin VB.PictureBox PICBar
- Height = 675
- Left = 180
- ScaleHeight = 615
- ScaleWidth = 3915
- TabIndex = 0
- Top = 180
- Width = 3975
- Begin VB.PictureBox PICProg
- Appearance = 0 'Flat
- BackColor = &H00FF0000&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 645
- Left = 0
- Picture = "Progress.ctx":0000
- ScaleHeight = 645
- ScaleWidth = 1965
- TabIndex = 1
- Top = 0
- Width = 1965
- Begin VB.Label LBLPer
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "50%"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FFFFFF&
- Height = 225
- Left = -30
- TabIndex = 2
- Top = 210
- Width = 1965
- End
- End
- End
- End
- Attribute VB_Name = "Progress"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim MaxNumber As Integer
-
- Private Sub UserControl_Initialize()
- MaxNumber = 100
- End Sub
-
- Private Sub UserControl_Resize()
- PICBar.Left = 0
- PICBar.Top = 0
- PICBar.Width = UserControl.Width
- PICBar.Height = UserControl.Height
- PICProg.Left = 0
- PICProg.Top = 0
- PICProg.Width = PICBar.Width / 2
- PICProg.Height = PICBar.Height
- LBLPer.Top = (PICBar.Height / 2) - (LBLPer.Height / 2)
- LBLPer.Left = 0
- LBLPer.Width = PICProg.Width
- End Sub
-
- Public Property Get MaxValue() As Integer
- MaxValue = MaxNumber
- End Property
-
- Public Property Let MaxValue(ByVal NewMax As Integer)
- MaxNumber = NewMax
- End Property
-
- Public Function UpdateTo(CurrentValue As Integer)
- If CurrentValue < MaxNumber Then
- PICProg.Width = (CurrentValue / MaxNumber) * PICBar.Width
- LBLPer.Caption = Format((CurrentValue / MaxNumber), "0%")
- LBLPer.Width = PICProg.Width
- Else
- PICProg.Width = PICBar.Width
- LBLPer.Caption = "100%"
- LBLPer.Width = PICProg.Width
- End If
- UserControl.Refresh
- End Function
-