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

📄 modrecentlist.bas

📁 WinBig. A file archive utility written in VB. Compression and decompression routines are LZSS. Full
💻 BAS
字号:
Attribute VB_Name = "ModRecentList"
Option Explicit

Public Const ThisKey = "Recent Files"

Sub GetRecentFiles(frm As Form)
    Dim i As Integer
    Dim varFiles As Variant
    
    If GetSetting(App.EXEName, ThisKey, "RecentFile1") = Empty Then Exit Sub
    
    varFiles = GetAllSettings(App.EXEName, ThisKey)
    
    For i = 0 To UBound(varFiles, 1)
        frm.mnuRecentFile(0).Visible = True
        frm.mnuRecentFile(i + 1).Caption = "&" & (i + 1) & " " & varFiles(i, 1)
        frm.mnuRecentFile(i + 1).Visible = True
    Next i
End Sub

Sub WriteRecentFiles(frm As Form, OpenFileName)
    Dim i As Integer
    Dim strFile As String, strKey As String, strShort As String

    For i = 1 To 4
        If LCase(Mid(frm.mnuRecentFile(i).Caption, 4)) = LCase(OpenFileName) Then
            Exit Sub
        End If
    Next i
    
    For i = 3 To 1 Step -1
        strKey = "RecentFile" & i
        strFile = GetSetting(App.EXEName, ThisKey, strKey)
        If strFile <> "" Then
            strKey = "RecentFile" & (i + 1)
            SaveSetting App.EXEName, ThisKey, strKey, strFile
        End If
    Next i
  
    SaveSetting App.EXEName, ThisKey, "RecentFile1", UCase(OpenFileName)
End Sub

⌨️ 快捷键说明

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