⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 digitalclock.ctl

📁 简单的数字时钟
💻 CTL
字号:
VERSION 5.00
Begin VB.UserControl DigitalClock 
   ClientHeight    =   1125
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4935
   ScaleHeight     =   1125
   ScaleWidth      =   4935
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00000000&
      Height          =   1215
      Left            =   0
      ScaleHeight     =   1155
      ScaleWidth      =   4875
      TabIndex        =   0
      Top             =   0
      Width           =   4935
      Begin VB.Timer Timer1 
         Interval        =   1000
         Left            =   240
         Top             =   240
      End
      Begin VB.Timer Timer2 
         Interval        =   200
         Left            =   960
         Top             =   240
      End
      Begin VB.Image Image1 
         Height          =   855
         Index           =   0
         Left            =   120
         Top             =   120
         Width           =   600
      End
      Begin VB.Image Image1 
         Height          =   855
         Index           =   5
         Left            =   4200
         Top             =   120
         Width           =   600
      End
      Begin VB.Image Image1 
         Height          =   855
         Index           =   4
         Left            =   3480
         Top             =   120
         Width           =   600
      End
      Begin VB.Shape Shape1 
         BackColor       =   &H0000FFFF&
         BackStyle       =   1  'Opaque
         Height          =   135
         Index           =   3
         Left            =   3240
         Top             =   480
         Width           =   135
      End
      Begin VB.Shape Shape1 
         BackColor       =   &H0000FFFF&
         BackStyle       =   1  'Opaque
         Height          =   135
         Index           =   2
         Left            =   3240
         Top             =   840
         Width           =   135
      End
      Begin VB.Image Image1 
         Height          =   855
         Index           =   3
         Left            =   2520
         Top             =   120
         Width           =   600
      End
      Begin VB.Image Image1 
         Height          =   855
         Index           =   2
         Left            =   1800
         Top             =   120
         Width           =   600
      End
      Begin VB.Shape Shape1 
         BackColor       =   &H0000FFFF&
         BackStyle       =   1  'Opaque
         Height          =   135
         Index           =   1
         Left            =   1560
         Top             =   840
         Width           =   135
      End
      Begin VB.Shape Shape1 
         BackColor       =   &H0000FFFF&
         BackStyle       =   1  'Opaque
         Height          =   135
         Index           =   0
         Left            =   1560
         Top             =   480
         Width           =   135
      End
      Begin VB.Image Image1 
         Height          =   855
         Index           =   1
         Left            =   840
         Top             =   120
         Width           =   600
      End
   End
End
Attribute VB_Name = "DigitalClock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True


Public Event Click()
Private Sub Image1_Click(Index As Integer)
    RaiseEvent Click
End Sub
Private Sub Picture1_Click()
    RaiseEvent Click
End Sub
Private Sub UserControl_Click()
    RaiseEvent Click
End Sub

Private Sub Timer1_Timer()
    Dim strTime As String
    Dim T(5) As String
    Dim i As Integer
    strTime = Time$
    For i = 0 To 3
        Shape1(i).Visible = False
    Next i
    T(0) = Mid(strTime, 1, 1)
    T(1) = Mid(strTime, 2, 1)
    T(2) = Mid(strTime, 4, 1)
    T(3) = Mid(strTime, 5, 1)
    T(4) = Mid(strTime, 7, 1)
    T(5) = Mid(strTime, 8, 1)
    For i = 0 To 5
        Select Case T(i)
            Case "0"
                Image1(i).Picture = LoadResPicture(101, 0)
            Case "1"
                Image1(i).Picture = LoadResPicture(102, 0)
            Case "2"
                Image1(i).Picture = LoadResPicture(103, 0)
            Case "3"
                Image1(i).Picture = LoadResPicture(104, 0)
            Case "4"
                Image1(i).Picture = LoadResPicture(105, 0)
            Case "5"
                Image1(i).Picture = LoadResPicture(106, 0)
            Case "6"
                Image1(i).Picture = LoadResPicture(107, 0)
            Case "7"
                Image1(i).Picture = LoadResPicture(108, 0)
            Case "8"
                Image1(i).Picture = LoadResPicture(109, 0)
            Case "9"
                Image1(i).Picture = LoadResPicture(110, 0)
        End Select
    Next i
 End Sub

Private Sub Timer2_Timer()
    For i = 0 To 3
        Shape1(i).Visible = True
    Next i
End Sub

Private Sub UserControl_Initialize()
    Dim strTime As String
    Dim T(5) As String
    Dim i As Integer
    strTime = Time$
    T(0) = Mid(strTime, 1, 1)
    T(1) = Mid(strTime, 2, 1)
    T(2) = Mid(strTime, 4, 1)
    T(3) = Mid(strTime, 5, 1)
    T(4) = Mid(strTime, 7, 1)
    T(5) = Mid(strTime, 8, 1)
    For i = 0 To 5
        Select Case T(i)
            Case "0"
                Image1(i).Picture = LoadResPicture(101, 0)
            Case "1"
                Image1(i).Picture = LoadResPicture(102, 0)
            Case "2"
                Image1(i).Picture = LoadResPicture(103, 0)
            Case "3"
                Image1(i).Picture = LoadResPicture(104, 0)
            Case "4"
                Image1(i).Picture = LoadResPicture(105, 0)
            Case "5"
                Image1(i).Picture = LoadResPicture(106, 0)
            Case "6"
                Image1(i).Picture = LoadResPicture(107, 0)
            Case "7"
                Image1(i).Picture = LoadResPicture(108, 0)
            Case "8"
                Image1(i).Picture = LoadResPicture(109, 0)
            Case "9"
                Image1(i).Picture = LoadResPicture(110, 0)
        End Select
    Next i
End Sub
Public Property Get ModifyInterval() As Variant
Attribute ModifyInterval.VB_Description = "该属性用于设置时钟的间隔时间"
    ModifyInterval = Timer1.Interval
End Property

Public Property Let ModifyInterval(ByVal vNewValue As Variant)
    Timer1.Interval = vNewValue
    PropertyChanged (ModifyInterval)
End Property
Public Function About()
    MsgBox ("作者:赵学惠")
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -