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

📄 frmbookcollection.frm

📁 用VB语言编写的电子书阅读器
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmBookCollection 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   5  'Sizable ToolWindow
   ClientHeight    =   7365
   ClientLeft      =   14760
   ClientTop       =   4065
   ClientWidth     =   4230
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7365
   ScaleWidth      =   4230
   ShowInTaskbar   =   0   'False
   Begin VB.ListBox listBookPath 
      Height          =   420
      Left            =   3840
      TabIndex        =   1
      Top             =   2160
      Visible         =   0   'False
      Width           =   615
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   3960
      Top             =   5400
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   4
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmBookCollection.frx":0000
            Key             =   "Book"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmBookCollection.frx":0452
            Key             =   "OpenedBook"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmBookCollection.frx":08A4
            Key             =   "Chapter"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmBookCollection.frx":0CF6
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.TreeView treeBookCollection 
      Height          =   6135
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   3495
      _ExtentX        =   6165
      _ExtentY        =   10821
      _Version        =   393217
      Style           =   5
      FullRowSelect   =   -1  'True
      SingleSel       =   -1  'True
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Image Image3 
      Height          =   480
      Left            =   1920
      Picture         =   "frmBookCollection.frx":1148
      ToolTipText     =   "看书"
      Top             =   6600
      Width           =   480
   End
   Begin VB.Image Image2 
      Height          =   240
      Left            =   3720
      Picture         =   "frmBookCollection.frx":158A
      ToolTipText     =   "删除"
      Top             =   6720
      Width           =   240
   End
   Begin VB.Image Image1 
      Height          =   195
      Left            =   360
      Picture         =   "frmBookCollection.frx":168C
      ToolTipText     =   "添加新书"
      Top             =   6720
      Width           =   195
   End
End
Attribute VB_Name = "frmBookCollection"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public boolAddBook As Boolean       '标志打开frmDirectory的目的

Private Sub Image1_Click()      '添加新书
    boolAddBook = True      '添加书
    frmMusic.boolAddMusic = False
    frmDirectory.Show
        
End Sub

Private Sub Image2_Click()      '删除所选书及其子目录
    Dim i As Integer

    If treeBookCollection.SelectedItem.Index = 1 Then
        MsgBox "不能删除书架", 0 + vbInformation, "错误"
    ElseIf treeBookCollection.SelectedItem.Key Like "*Chapter*" Then
        MsgBox "这只是一章节,请选择一本书", 0 + vbInformation, "提示"
    Else
        If boolBookFlag Then
            For i = 0 To UBound(strBookFlag(), 2)
                If listBookPath.List(treeBookCollection.SelectedItem.Index - 2) = strBookFlag(2, i) Then        '先删除可能存在的书签
                    strBookFlag(2, i) = ""
                    Exit For
                End If
            Next i
        End If
        For i = 0 To treeBookCollection.SelectedItem.Children
            listBookPath.RemoveItem treeBookCollection.SelectedItem.Index - 2       '删除相应的路径信息
        Next i
        treeBookCollection.Nodes.Remove treeBookCollection.SelectedItem.Index       '删除书
    End If

End Sub

Private Sub Image3_Click()      '隐藏书架

    frmBookCollection.Hide

End Sub

Private Sub treeBookCollection_NodeClick(ByVal Node As MSComctlLib.Node)        '装载文件
    Dim i As Integer
    
    If Node.Index = 1 Then      '用户单击“我的书架”初始标志
        frmBook.picBook1.Cls
        frmBook.picBook2.Cls
        frmMenu.mnuBookFlag.Enabled = False
    ElseIf Node.Key Like "*Chapter*" Then       '用户单击子结点
        OpenFile (listBookPath.List(Node.Index - 2))   '调用过程打开文件
        Transfer        '调用过程,编排格式
        frmBook.intReadFlag = 0
        frmBook.NextPage
        frmBook.SetFocus
        frmMenu.mnuBookFlag.Enabled = True
    ElseIf boolBookFlag Then        '用户单击的是书结点,如果书签可用,扫描书签看是否有记录
        frmBook.picBook1.Cls
        frmBook.picBook2.Cls
        frmMenu.mnuBookFlag.Enabled = False
        For i = 0 To UBound(strBookFlag(), 2)
            If listBookPath.List(Node.Index - 2) = strBookFlag(2, i) Then       '书签中有记录,显示书签所记录的页
                OpenFile (strBookFlag(2, i) & "\" & strBookFlag(1, i))
                Transfer
                frmBook.intReadFlag = strBookFlag(0, i)
                frmBook.NextPage
                frmBook.PreviousPage
                frmBook.SetFocus
                frmMenu.mnuBookFlag.Enabled = True
                Exit For
            End If
        Next i
    End If
    
End Sub

⌨️ 快捷键说明

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