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

📄 打开记事本并自动保存.frm

📁 打开记事本并自动保存
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form1 
   BackColor       =   &H8000000D&
   Caption         =   "Form1"
   ClientHeight    =   2295
   ClientLeft      =   3600
   ClientTop       =   3570
   ClientWidth     =   3555
   Icon            =   "打开记事本并自动保存.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   2295
   ScaleWidth      =   3555
   Begin MSComCtl2.UpDown UpDown1 
      Height          =   375
      Left            =   2160
      TabIndex        =   2
      Top             =   720
      Width           =   255
      _ExtentX        =   450
      _ExtentY        =   661
      _Version        =   393216
      Value           =   1
      AutoBuddy       =   -1  'True
      BuddyControl    =   "Text1"
      BuddyDispid     =   196609
      OrigLeft        =   5280
      OrigTop         =   2640
      OrigRight       =   5535
      OrigBottom      =   3375
      Max             =   20
      Min             =   1
      SyncBuddy       =   -1  'True
      Wrap            =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1080
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   720
      Width           =   1080
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   4200
      Top             =   600
   End
   Begin VB.Label Label4 
      BackColor       =   &H8000000D&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "  退出"
      Height          =   255
      Left            =   1920
      TabIndex        =   5
      Top             =   1320
      Width           =   735
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      BorderStyle     =   1  'Fixed Single
      Caption         =   "  确定"
      Height          =   255
      Left            =   840
      TabIndex        =   4
      Top             =   1320
      Width           =   735
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "田草-Tiancao"
      ForeColor       =   &H000000FF&
      Height          =   495
      Left            =   1680
      TabIndex        =   3
      Top             =   1800
      Width           =   1335
      WordWrap        =   -1  'True
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Height          =   300
      Left            =   960
      TabIndex        =   0
      Top             =   240
      Width           =   3090
   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 findwindow Lib "user32" Alias "FindWindowA" (ByVal lpclassname As String, ByVal ipwindowname As String) As Long
Dim i As Integer

Private Sub Form_Load()
Label1.Caption = "输入自动保存的时间" + Chr(13) + "    以分钟为单位"
Form1.Text1 = GetSetting("autosavedtime", "time", "time", 0)
Form1.Left = Screen.Width / 2 - 2000
Form1.Top = Screen.Height / 2 - 2000
Form1.Caption = "记事本自动保存"
Shell "notepad.exe", vbNormalNoFocus '打开记事本,但不使其成为当前窗口。
Timer1.Enabled = True
Form1.WindowState = 0
End Sub

Private Sub Form_Unload(Cancel As Integer)
SaveSetting "autosavedtime", "time", "time", Form1.Text1.Text
End Sub

Private Sub Label3_Click()
Me.WindowState = 1
Timer1.Enabled = True
End Sub

Private Sub Label4_Click()
End
End Sub

Private Sub Timer1_Timer()
If findwindow("Notepad", vbNullString) Then
Dim b As Integer
b = UpDown1.Value
i = i + 1
If i Mod b * 60 = 0 Then
SendKeys "%(FS)", True '"%"表示alt键,括号里代表的是"文件(F)"和"保存(s)"
End If
Else
Unload Me
End If
End Sub

⌨️ 快捷键说明

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