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

📄 timer.frm

📁 初步简单的定时程序 探讨如何实现指定时间的提示,没有声音,只是弹出程序框
💻 FRM
字号:
VERSION 5.00
Object = "{60CC5D62-2D08-11D0-BDBE-00AA00575603}#1.0#0"; "SYSTRAY5.OCX"
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Timer"
   ClientHeight    =   2775
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   8130
   Icon            =   "Timer.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2775
   ScaleWidth      =   8130
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin SysTrayCtl.cSysTray cSysTray1 
      Left            =   3480
      Top             =   2040
      _ExtentX        =   900
      _ExtentY        =   900
      InTray          =   0   'False
      TrayIcon        =   "Timer.frx":1272
      TrayTip         =   "打卡定时器 12:30"
   End
   Begin VB.Timer Timer1 
      Interval        =   30000
      Left            =   5280
      Top             =   840
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "It's Time ..."
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   315
      Left            =   1200
      TabIndex        =   0
      Top             =   960
      Width           =   2340
   End
   Begin VB.Menu m 
      Caption         =   "m"
      Visible         =   0   'False
      Begin VB.Menu e 
         Caption         =   "退出定时器"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndlnserAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wflags As Long) As Long
'Private Sub Check1_Click()
'If Check1.Value = 0 Then
'   SetWindowPos hwnd, -2, 0, 0, 0, 0, &H1 Or &H2 '取消总在最前
'Else
'   SetWindowPos hwnd, -1, 0, 0, 0, 0, &H1 Or &H2 '设为总在最前
'End If
'End Sub


Private Sub cSysTray1_MouseUp(Button As Integer, Id As Long)
If Button = 1 Then
Me.Visible = True
cSysTray1.InTray = False
Else
   PopupMenu m
End If
End Sub

Private Sub e_Click()
Unload Me
End Sub

Private Sub Form_Load()
SetWindowPos hwnd, -1, 0, 0, 0, 0, &H1 Or &H2 '设为总在最前
Me.Hide
cSysTray1.InTray = True
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then
   Me.Hide
   Cancel = 1
   cSysTray1.InTray = True
End If
End Sub

Private Sub Timer1_Timer()
If Format(Time, "hh:mm") = "12:30" Then
   If Me.WindowState <> 0 Then Me.WindowState = 0
   Me.Visible = True
   cSysTray1.InTray = False
End If
End Sub

⌨️ 快捷键说明

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