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

📄 多用电子表.frm

📁 基于Visual Basic 6.0的多用电子表设计
💻 FRM
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form frm多用电子表 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "多用电子表"
   ClientHeight    =   2520
   ClientLeft      =   5040
   ClientTop       =   2580
   ClientWidth     =   3825
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2520
   ScaleWidth      =   3825
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame2 
      Caption         =   "请您定时"
      Height          =   1095
      Left            =   0
      TabIndex        =   7
      Top             =   1320
      Visible         =   0   'False
      Width           =   3735
      Begin VB.CommandButton cmdOK 
         Caption         =   "确定"
         Height          =   375
         Left            =   120
         TabIndex        =   10
         Top             =   600
         Width           =   975
      End
      Begin VB.CheckBox chkAlarm 
         Caption         =   "闹钟无效"
         Height          =   180
         Left            =   120
         TabIndex        =   9
         Top             =   240
         Width           =   255
      End
      Begin RichTextLib.RichTextBox rtbdate 
         Height          =   375
         Left            =   1440
         TabIndex        =   15
         Top             =   600
         Width           =   975
         _ExtentX        =   1720
         _ExtentY        =   661
         _Version        =   393217
         Enabled         =   -1  'True
         TextRTF         =   $"多用电子表.frx":0000
      End
      Begin RichTextLib.RichTextBox rtbtime 
         Height          =   375
         Left            =   2520
         TabIndex        =   16
         Top             =   600
         Width           =   975
         _ExtentX        =   1720
         _ExtentY        =   661
         _Version        =   393217
         Enabled         =   -1  'True
         TextRTF         =   $"多用电子表.frx":009D
      End
      Begin VB.Label lblAlarm 
         Alignment       =   2  'Center
         Caption         =   "闹钟无效"
         Height          =   375
         Left            =   360
         TabIndex        =   14
         Top             =   240
         Width           =   975
      End
      Begin VB.Label lblTime 
         Caption         =   "时间"
         Height          =   255
         Left            =   2520
         TabIndex        =   11
         Top             =   240
         Width           =   855
      End
      Begin VB.Label lblDate 
         Caption         =   "日期"
         Height          =   255
         Left            =   1440
         TabIndex        =   8
         Top             =   240
         Width           =   975
      End
   End
   Begin VB.Frame Frame1 
      Height          =   1335
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   3735
      Begin VB.CommandButton cmdAlarm 
         Caption         =   "闹钟"
         Height          =   255
         Left            =   2520
         TabIndex        =   13
         Top             =   960
         Width           =   615
      End
      Begin VB.Timer Timer1 
         Interval        =   1000
         Left            =   1800
         Top             =   0
      End
      Begin VB.CommandButton cmdClose 
         Caption         =   "关闭"
         Height          =   255
         Left            =   3120
         TabIndex        =   5
         Top             =   960
         Width           =   495
      End
      Begin VB.CommandButton cmdDate 
         Caption         =   "日期"
         Height          =   255
         Left            =   1920
         TabIndex        =   4
         Top             =   960
         Width           =   615
      End
      Begin VB.CommandButton cmdStart 
         Caption         =   "开始"
         Enabled         =   0   'False
         Height          =   255
         Left            =   120
         TabIndex        =   3
         Top             =   960
         Width           =   615
      End
      Begin VB.CommandButton cmdCls 
         Caption         =   "清零"
         Enabled         =   0   'False
         Height          =   255
         Left            =   720
         TabIndex        =   2
         Top             =   960
         Width           =   615
      End
      Begin VB.CommandButton cmdTime 
         Caption         =   "秒表"
         Height          =   255
         Left            =   1320
         TabIndex        =   1
         Top             =   960
         Width           =   615
      End
      Begin VB.Label lblShowDate 
         BackColor       =   &H80000008&
         BackStyle       =   0  'Transparent
         ForeColor       =   &H00FFFFFF&
         Height          =   375
         Left            =   840
         TabIndex        =   12
         Top             =   480
         Width           =   2295
      End
      Begin VB.Label lblShowTime 
         Alignment       =   2  'Center
         BackColor       =   &H80000008&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000E&
         Height          =   735
         Left            =   120
         TabIndex        =   6
         Top             =   120
         Width           =   3495
      End
   End
End
Attribute VB_Name = "frm多用电子表"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim flag As Boolean
Dim mytime, ttime, mydate, yourdate, yourtime As Date



Private Sub cmdStart_Click()
Timer1.Interval = 1
If cmdStart.Caption = "开始" Then
    cmdStart.Caption = "停止"
   cmdCls.Enabled = False
Else
    cmdStart.Caption = "开始"
     cmdCls.Enabled = True
End If
End Sub

Private Sub cmdCls_Click()
ttime = "00:00:00"
lblShowTime.Caption = CStr(ttime)
End Sub

Private Sub cmdTime_Click()
If cmdTime.Caption = "时间" Then
cmdTime.Caption = "秒表"
Timer1.Interval = 1000
ttime = "00:00:00"
cmdStart.Enabled = False
cmdCls.Enabled = False
Else
cmdTime.Caption = "时间"
cmdStart.Enabled = True
ttime = "00:00:00"
lblShowTime.Caption = CStr(ttime)
End If
End Sub

Private Sub cmdAlarm_Click()
Me.Height = 2850
Me.Frame2.Visible = True
End Sub

Private Sub cmdDate_Click()
Me.lblShowDate.Caption = CStr(mydate)
End Sub

Private Sub cmdClose_Click()
Unload frmClock
frmMain.Show
End Sub

Private Sub cmdOK_Click()
Me.Frame2.Visible = False
Me.Height = 1695
yourdate = CDate(rtbdate.Text)
yourtime = CDate(rtbtime.Text)
rtbdate.SaveFile ("c:\date.txt")
rtbtime.SaveFile ("c:\time.txt")
End Sub

Private Sub Form_Load()
On Error Resume Next
Me.Height = 1620
rtbdate.LoadFile ("c:\date.txt")
yourdate = CDate(rtbdate.Text)
rtbtime.LoadFile "c:\time.txt"
yourtime = CDate(rtbtime.Text)
Me.Show
End Sub

Private Sub Label4_Click()

End Sub

Private Sub Timer1_Timer()
mydate = Date
mytime = Time
If cmdTime.Caption = "秒表" Then
    lblShowTime.Caption = CStr(mytime)
ElseIf (cmdTime.Caption = "时间" And cmdStart.Caption = "停止") Then
    lblShowTime.Caption = CStr(ttime)
    ttime = TimeValue(ttime) + TimeValue("00:00:01")
End If
If ((chkAlarm.Value = 0) And Hour(mytime) = Hour(yourtime) And Minute(mytime) = Minute(yourtime) And (mydate = yourdate)) Then
Beep
End If
End Sub

⌨️ 快捷键说明

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