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

📄 frmmain.frm

📁 个人记事本
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain 
   Caption         =   "Note"
   ClientHeight    =   4470
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   4455
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   4470
   ScaleWidth      =   4455
   StartUpPosition =   2  '屏幕中心
   Begin VB.PictureBox Picture1 
      Height          =   4455
      Left            =   0
      Picture         =   "frmMain.frx":08CA
      ScaleHeight     =   4395
      ScaleWidth      =   4395
      TabIndex        =   0
      Top             =   0
      Width           =   4455
      Begin VB.PictureBox PicMenuOption 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   1320
         Picture         =   "frmMain.frx":6AD1
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   8
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.PictureBox PicMenuHelp 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   1680
         Picture         =   "frmMain.frx":6D1B
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   7
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.PictureBox PicMenuEmail 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   2040
         Picture         =   "frmMain.frx":6F65
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   6
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.PictureBox PicMenuWeb 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   2400
         Picture         =   "frmMain.frx":71AF
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   5
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.PictureBox PicMenuNote 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   2760
         Picture         =   "frmMain.frx":73F9
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   4
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.PictureBox PicMenuNew 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   600
         Picture         =   "frmMain.frx":7643
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   3
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.PictureBox PicMenuOpen 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   240
         Picture         =   "frmMain.frx":788D
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   2
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
      Begin VB.PictureBox PicMenuClose 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   195
         Left            =   960
         Picture         =   "frmMain.frx":7AD7
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   1
         Top             =   120
         Visible         =   0   'False
         Width           =   195
      End
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   0
      Top             =   120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Menu menuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu menuFileOpen 
         Caption         =   "打开(&O)..."
         Shortcut        =   ^O
      End
      Begin VB.Menu menuFileNew 
         Caption         =   "新建(&N)..."
         Shortcut        =   ^N
      End
      Begin VB.Menu menuFileL1 
         Caption         =   "-"
      End
      Begin VB.Menu menuFileRecent 
         Caption         =   ""
         Index           =   0
         Visible         =   0   'False
      End
      Begin VB.Menu menuFileL2 
         Caption         =   "-"
      End
      Begin VB.Menu menuFileExit 
         Caption         =   "退出 Note (&E)"
      End
   End
   Begin VB.Menu menuOption 
      Caption         =   "选项(&O)"
      Begin VB.Menu menuOptionCipher 
         Caption         =   "设置密码(&C)..."
      End
      Begin VB.Menu menuOptionL1 
         Caption         =   "-"
      End
      Begin VB.Menu menuOptionParameter 
         Caption         =   "修改参数(P)..."
      End
   End
   Begin VB.Menu menuHelp 
      Caption         =   "帮助(&H)"
      Begin VB.Menu menuHelpSubject 
         Caption         =   "帮助主题(&H)"
      End
      Begin VB.Menu menuHelpReadme 
         Caption         =   "自述文件(&R)"
      End
      Begin VB.Menu menuHelpSentmail 
         Caption         =   "写信给我(&M)"
      End
      Begin VB.Menu menuHelpWeb 
         Caption         =   "到我的网站来看看(&W)"
      End
      Begin VB.Menu menuHelpL1 
         Caption         =   "-"
      End
      Begin VB.Menu menuHelpAbout 
         Caption         =   "关于 Note (&A)"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'//////////////////////////////////////////////////////
'///    for BitMapsMenu
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked As Long) As Long
Const myflage = &H400&

Private Sub Form_Activate()
    Dim i As Integer
    For i = 1 To RecentCount
        Load menuFileRecent(i)
        menuFileRecent(i).Caption = "&" & i & "  " & Recent(RecentCount - i + 1)
        menuFileRecent(i).Visible = True
    Next
End Sub

Private Sub Form_Deactivate()
    Dim i As Integer
    For i = 1 To menuFileRecent.Count - 1
        Unload menuFileRecent(i)
    Next
End Sub

Private Sub Form_Load()
'/////////////////////////////////////////////////////////
'////   BMPMenu
    Dim mHandle As Long, IRet As Long, sHandle As Long
    mHandle = GetMenu(hwnd)
    sHandle = GetSubMenu(mHandle, 0)
    IRet = SetMenuItemBitmaps(sHandle, 0, myflage, PicMenuOpen, PicMenuOpen)
    IRet = SetMenuItemBitmaps(sHandle, 1, myflage, PicMenuNew, PicMenuNew)
    IRet = SetMenuItemBitmaps(sHandle, 4, myflage, PicMenuClose, PicMenuClose)
    
    sHandle = GetSubMenu(mHandle, 1)
    IRet = SetMenuItemBitmaps(sHandle, 2, myflage, PicMenuOption, PicMenuOption)
    
    sHandle = GetSubMenu(mHandle, 2)
    IRet = SetMenuItemBitmaps(sHandle, 0, myflage, PicMenuHelp, PicMenuHelp)
    IRet = SetMenuItemBitmaps(sHandle, 2, myflage, PicMenuEmail, PicMenuEmail)
    IRet = SetMenuItemBitmaps(sHandle, 3, myflage, PicMenuWeb, PicMenuWeb)
    IRet = SetMenuItemBitmaps(sHandle, 5, myflage, PicMenuNote, PicMenuNote)
End Sub

'/////////////////////////////////////////////////////////////////////////
'//     菜单
Private Sub menuFileOpen_Click()
    CommonDialog1.FileName = ""
    CommonDialog1.InitDir = QueryValue(HKEY_CURRENT_USER, "Software\Note", "TacitlySaveFolder")
    CommonDialog1.Filter = "Note Files (*.not)|*.not"
    CommonDialog1.CancelError = True    '按“取消”,产生错误信息
    On Error GoTo OpenCancel
    CommonDialog1.ShowOpen
    FName = CommonDialog1.FileName  '将打开的文件名存入FName
    
    If Dir(FName) = "" Then
        MsgBox FName & "不存在", vbInformation + vbOKOnly, "错误信息"
        Exit Sub
    End If
    
    Dim frmD As New frmnote         '建立一个窗口 note 的实例
    frmD.Show
    DBCount = DBCount + 1
    Unload Me
OpenCancel:
End Sub

Private Sub menuFileNew_Click()
    CommonDialog1.FileName = ""
    CommonDialog1.InitDir = QueryValue(HKEY_CURRENT_USER, "Software\Note", "TacitlySaveFolder")
    CommonDialog1.Filter = "Note Files (*.not)|*.not"
    CommonDialog1.CancelError = True    '按“取消”,产生错误信息
    On Error GoTo OpenCancel
    CommonDialog1.ShowOpen
    FName = CommonDialog1.FileName  '将打开的文件名存入FName
    
    If Not Dir(FName) = "" Then     '如果文件已存在,询问是否覆盖
        If MsgBox(FName & "文件已存在,是否覆盖?", vbYesNo + _
            vbExclamation, "提示信息") = vbNo Then Exit Sub
    End If
    
    FileCopy App.Path & "\System\model.not", FName '通过复制数据库model.not 建立新数据库
    Dim frmD As New frmnote         '建立一个窗口 note 的实例
    frmD.Show
    DBCount = DBCount + 1
    Unload Me
OpenCancel:
End Sub

Private Sub menuFileRecent_Click(Index As Integer)
    FName = Recent(RecentCount - Index + 1)  '将打开的文件名存入FName
    
    If Dir(FName) = "" Then
        MsgBox FName & "已不存在", vbInformation + vbOKOnly, "错误信息"
        Exit Sub
    End If
    
    Dim frmD As New frmnote         '建立一个窗口 note 的实例
    frmD.Show
    DBCount = DBCount + 1
    Unload Me
End Sub

Private Sub menuOptionCipher_Click()
    frmSetPassword.Show (1) '模式窗口
End Sub

Private Sub menuOptionParameter_Click()
    frmSetParameter.Show (1) '模式窗口
End Sub

Private Sub menuHelpSubject_Click()
    'help
End Sub

Private Sub menuHelpReadme_Click()
    CommandLine = "C:\WINDOWS\NOTEPAD.EXE " & App.Path & "\Readme.txt"
    x = Shell(CommandLine, vbNormalFocus)
End Sub

Private Sub menuHelpSentmail_Click()
    sendmail
End Sub

Private Sub menuHelpWeb_Click()
    gotoweb
End Sub

Private Sub menuHelpAbout_Click()
    frmAbout.Show (1)
End Sub


⌨️ 快捷键说明

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