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

📄 form1.frm

📁 日期报警,设定好日期,就会在指定的的时间报警,和行程表差不多
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00000000&
   BorderStyle     =   0  'None
   Caption         =   "Alarm"
   ClientHeight    =   2640
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   1560
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2640
   ScaleWidth      =   1560
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer3 
      Interval        =   250
      Left            =   960
      Top             =   3720
   End
   Begin VB.Timer Timer2 
      Interval        =   1
      Left            =   480
      Top             =   3720
   End
   Begin VB.Timer Timer1 
      Interval        =   5
      Left            =   0
      Top             =   3720
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H0000FF00&
      Caption         =   "Set an alarm"
      Height          =   255
      Left            =   0
      MaskColor       =   &H00FFFFFF&
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   2160
      Width           =   1575
   End
   Begin VB.Label Label3 
      BackColor       =   &H00000000&
      Caption         =   "Made By: OverFlow"
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   0
      TabIndex        =   6
      Top             =   2400
      Width           =   1575
   End
   Begin VB.Image Image2 
      Height          =   135
      Left            =   1320
      Top             =   0
      Width           =   135
   End
   Begin VB.Line Line6 
      BorderColor     =   &H0000FF00&
      BorderWidth     =   5
      X1              =   0
      X2              =   1560
      Y1              =   2040
      Y2              =   2040
   End
   Begin VB.Line Line5 
      BorderColor     =   &H0000FF00&
      BorderWidth     =   2
      X1              =   1320
      X2              =   1440
      Y1              =   120
      Y2              =   120
   End
   Begin VB.Shape Shape2 
      BorderColor     =   &H0000FF00&
      Height          =   135
      Left            =   1320
      Top             =   0
      Width           =   135
   End
   Begin VB.Shape Shape1 
      BorderColor     =   &H0000FF00&
      Height          =   135
      Left            =   1440
      Top             =   0
      Width           =   135
   End
   Begin VB.Label AlarmDate 
      Alignment       =   2  'Center
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   0
      TabIndex        =   4
      Top             =   1680
      Width           =   1575
   End
   Begin VB.Label Label4 
      BackColor       =   &H00000000&
      Caption         =   "Alarm Date"
      ForeColor       =   &H0000FF00&
      Height          =   255
      Left            =   360
      TabIndex        =   3
      Top             =   1440
      Width           =   855
   End
   Begin VB.Line Line4 
      BorderColor     =   &H0000FF00&
      BorderWidth     =   5
      X1              =   0
      X2              =   1560
      Y1              =   1320
      Y2              =   1320
   End
   Begin VB.Label CurrentDate 
      Alignment       =   2  'Center
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   0
      TabIndex        =   2
      Top             =   960
      Width           =   1575
   End
   Begin VB.Label Label2 
      BackColor       =   &H00000000&
      Caption         =   "Current Date"
      ForeColor       =   &H0000FF00&
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   720
      Width           =   975
   End
   Begin VB.Line Line3 
      BorderColor     =   &H0000FF00&
      X1              =   1560
      X2              =   1440
      Y1              =   0
      Y2              =   120
   End
   Begin VB.Line Line2 
      BorderColor     =   &H0000FF00&
      X1              =   1440
      X2              =   1560
      Y1              =   0
      Y2              =   120
   End
   Begin VB.Image Image1 
      Height          =   135
      Left            =   1440
      Top             =   0
      Width           =   135
   End
   Begin VB.Line Line1 
      BorderColor     =   &H000000FF&
      BorderWidth     =   5
      X1              =   0
      X2              =   1560
      Y1              =   600
      Y2              =   600
   End
   Begin VB.Label Label1 
      BackColor       =   &H00000000&
      Caption         =   "Alarm"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   24
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   1335
   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 ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
Private Const SW_SHOWMAXIMIZED = 3


Private Sub Command1_Click()
Dim buff, resion, thing
buff = InputBox("Enter Numerical Date")
resion = InputBox("Enter Resion For Alarm")
Open App.Path & "\" & "Date.alm" For Output As #1
    Print #1, buff
Close #1
Open App.Path & "\" & "Resn.alm" For Output As #1
    Print #1, resion
Close #1
thing = "on"
Open App.Path & "\" & "onorof.alm" For Output As #1
    Print #1, thing
Close #1
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
Dim buff
CurrentDate = Format(Date, "Short Date")

If Exists(App.Path & "\" & "onorof.alm") = True Then
Open App.Path & "\" & "onorof.alm" For Input As #1
    Line Input #1, buff
Close #1
If buff = "on" Then
 Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End If
TrayIcon.cbSize = Len(TrayIcon)
TrayIcon.hWnd = Me.hWnd
TrayIcon.uId = vbNull
TrayIcon.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
TrayIcon.ucallbackMessage = WM_MOUSEMOVE
TrayIcon.hIcon = Me.Icon
TrayIcon.szTip = "DateAlarm" & Chr$(0)
Call Shell_NotifyIcon(NIM_ADD, TrayIcon)
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static message As Long
Static RR As Boolean
message = X / Screen.TwipsPerPixelX
If RR = False Then
RR = True
Select Case message
Case WM_LBUTTONDBLCLK
Me.Show
Case WM_RBUTTONUP
Me.PopupMenu Form2.rightclick, , , , Form2.h
End Select
RR = False
End If
End Sub

Private Sub Form_Resize()
If Me.WindowState = vbMinimized Then
Me.Hide
Me.WindowState = vbNormal
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
TrayIcon.cbSize = Len(TrayIcon)
TrayIcon.hWnd = Me.hWnd
TrayIcon.uId = vbNull
Call Shell_NotifyIcon(NIM_DELETE, TrayIcon)
End Sub

Private Sub Image1_Click()
End
End Sub

Private Sub Label5_Click()

End Sub

Private Sub Image2_Click()
Me.WindowState = vbMinimized
End Sub

Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End Sub

Private Sub Timer1_Timer()
Dim thing
If Exists(App.Path & "\" & "Date.alm") = True Then
Open App.Path & "\" & "Date.alm" For Input As #1
    Line Input #1, buff
Close #1
AlarmDate.Caption = buff
End If
If CurrentDate.Caption = AlarmDate.Caption Then
Open App.Path & "\" & "Resn.alm" For Input As #1
    Line Input #1, resion
Close #1
Dim a
For a = 1 To 5
MsgBox "Alarm Date " & Chr(13) & resion
Next a
AlarmDate.Caption = ""
thing = "off"
Open App.Path & "\" & "onorof.alm" For Output As #1
    Print #1, thing
Close #1
Timer1.Enabled = False: Exit Sub
End If
End Sub

Private Sub Timer2_Timer()
If AlarmDate.Caption = "" Then
AlarmDate.Caption = "Not Set"
End If
End Sub

Private Sub Timer3_Timer()
If Label3.Left = 0 Then
Label3.Left = 120
Else
Label3.Left = 0: Exit Sub
End If
End Sub

⌨️ 快捷键说明

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