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

📄 form1.frm

📁 很多的vb经典源代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "电子数码时钟"
   ClientHeight    =   1680
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4845
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1680
   ScaleWidth      =   4845
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command4 
      Caption         =   "白色数码"
      Height          =   495
      Left            =   3600
      TabIndex        =   6
      Top             =   1080
      Width           =   1095
   End
   Begin VB.CommandButton Command3 
      Caption         =   "绿色数码"
      Height          =   495
      Left            =   2520
      TabIndex        =   5
      Top             =   1080
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "红色数码"
      Height          =   495
      Left            =   1440
      TabIndex        =   4
      Top             =   1080
      Width           =   1095
   End
   Begin VB.PictureBox MaoHaoPic 
      AutoRedraw      =   -1  'True
      BorderStyle     =   0  'None
      Height          =   1095
      Left            =   3840
      Picture         =   "Form1.frx":0000
      ScaleHeight     =   73
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   17
      TabIndex        =   3
      Top             =   0
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.PictureBox SrcPic 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BorderStyle     =   0  'None
      Height          =   1035
      Left            =   -240
      Picture         =   "Form1.frx":02AA
      ScaleHeight     =   69
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   130
      TabIndex        =   2
      Top             =   0
      Visible         =   0   'False
      Width           =   1950
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   4320
      Top             =   120
   End
   Begin VB.CommandButton Command1 
      Caption         =   "启动数码时钟"
      Height          =   495
      Left            =   120
      TabIndex        =   1
      Top             =   1080
      Width           =   1335
   End
   Begin VB.PictureBox LEDPic 
      AutoRedraw      =   -1  'True
      BackColor       =   &H80000008&
      Height          =   495
      Left            =   1680
      ScaleHeight     =   29
      ScaleMode       =   0  'User
      ScaleWidth      =   109
      TabIndex        =   0
      Top             =   240
      Width           =   1695
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit



Private Sub Command1_Click()
Timer1.Enabled = True

End Sub

Private Sub Command2_Click()
color = 1
End Sub

Private Sub Picture1_Click()

End Sub

Private Sub Command3_Click()
color = 2
End Sub

Private Sub Command4_Click()
color = 3
End Sub

Private Sub Form_Load()
color = 1
End Sub

Private Sub Timer1_Timer()
   Dim fhHour As Integer
   Dim fhMin As Integer
   Dim fhSec As Integer
   Dim fhHour1 As Integer
   Dim fhHour2 As Integer
   Dim fhMin1 As Integer
   Dim fhMin2 As Integer
   Dim fhSec1 As Integer
   Dim fhSec2 As Integer
   fhHour = Hour(Now)
   fhMin = Minute(Now)
   fhSec = Second(Now)
   If fhHour < 10 Then
      fhHour1 = 0
      fhHour2 = fhHour
   Else
      fhHour1 = Int(fhHour / 10)
      fhHour2 = fhHour - fhHour1 * 10
   End If
   If fhMin < 10 Then
      fhMin1 = 0
      fhMin2 = fhMin
   Else
      fhMin1 = Int(fhMin / 10)
      fhMin2 = fhMin - fhMin1 * 10
   End If
   If fhSec < 10 Then
      fhSec1 = 0
      fhSec2 = fhSec
   Else
      fhSec1 = Int(fhSec / 10)
      fhSec2 = fhSec - fhSec1 * 10
   End If
  '------------
   ShowNum SrcPic, LEDPic, fhHour1, color, 1
   ShowNum SrcPic, LEDPic, fhHour2, color, 2
   ShowNum SrcPic, LEDPic, fhMin1, color, 4
   ShowNum SrcPic, LEDPic, fhMin2, color, 5
   ShowNum SrcPic, LEDPic, fhSec1, color, 7
   ShowNum SrcPic, LEDPic, fhSec2, color, 8
   '-----------
   ShowMaoHao MaoHaoPic, LEDPic, color
 '以下代码用于数码颜色改变后,即时改变冒号的显示颜色
 '当用户单击时间显示面板框时,可调整显示颜色

End Sub

⌨️ 快捷键说明

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