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

📄 fileview.frm

📁 国防工业部VB高级编程源码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":8E4E
            Key             =   "cddrive"
            Object.Tag             =   "光盘"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":92A2
            Key             =   "clsdfold"
            Object.Tag             =   "关闭文件夹"
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":96F6
            Key             =   "openfold"
            Object.Tag             =   "打开文件夹"
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":9B4A
            Key             =   "nethood"
            Object.Tag             =   "网上邻居"
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":9F9E
            Key             =   "netdrive"
            Object.Tag             =   "网络共享盘"
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":A3F2
            Key             =   "waste"
            Object.Tag             =   "回收站"
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":A846
            Key             =   "recyfull"
            Object.Tag             =   "回收站已满"
         EndProperty
         BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":AC9A
            Key             =   "file"
            Object.Tag             =   "文件"
         EndProperty
         BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FileView.frx":B0EE
            Key             =   "open"
            Object.Tag             =   "打开文件"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.TreeView tvwFile 
      Height          =   2535
      Left            =   960
      TabIndex        =   1
      Top             =   1920
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   4471
      _Version        =   393217
      Indentation     =   176
      Style           =   7
      ImageList       =   "imglTvw"
      Appearance      =   1
   End
   Begin MSComctlLib.StatusBar stbForm 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   0
      Top             =   6330
      Width           =   8385
      _ExtentX        =   14790
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   4207
            MinWidth        =   2646
            Key             =   "new"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   4207
            MinWidth        =   2646
            Key             =   "size"
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            Object.Width           =   1411
            MinWidth        =   1411
            TextSave        =   "21:41"
            Key             =   "time"
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   6
            Object.Width           =   1764
            MinWidth        =   1764
            TextSave        =   "00-11-22"
            Key             =   "date"
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Bevel           =   0
            Object.Width           =   2478
            MinWidth        =   917
            Picture         =   "FileView.frx":B542
            Text            =   "版权所有(C) Flyer Corp"
            TextSave        =   "版权所有(C) Flyer Corp"
            Key             =   "welcome"
         EndProperty
      EndProperty
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuFileCreate 
         Caption         =   "新建(&N)"
         Begin VB.Menu mnuFileFldr 
            Caption         =   "文件夹"
         End
         Begin VB.Menu mnuFileTxt 
            Caption         =   "文本文件"
         End
      End
      Begin VB.Menu mnuFileOpen 
         Caption         =   "打开(&O)"
      End
      Begin VB.Menu mnuFileLine0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileAttr 
         Caption         =   "属性(&R)..."
      End
      Begin VB.Menu mnuFileLine1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileClose 
         Caption         =   "关闭(&C)"
      End
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "编辑(&E)"
      Begin VB.Menu mnuEditCopy 
         Caption         =   "复制(&C)"
         Shortcut        =   ^C
      End
      Begin VB.Menu mnuEditCut 
         Caption         =   "剪切(&T)"
         Shortcut        =   ^X
      End
      Begin VB.Menu mnuEditPaste 
         Caption         =   "粘贴(&P)"
         Shortcut        =   ^V
      End
      Begin VB.Menu mnuEditLine0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditDel 
         Caption         =   "删除(&D)"
      End
      Begin VB.Menu munEditLine1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditReN 
         Caption         =   "重命名(&R)"
      End
      Begin VB.Menu mnuEditLine2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditSelAll 
         Caption         =   "全选(&A)"
         Shortcut        =   ^A
      End
      Begin VB.Menu mnuFileSelR 
         Caption         =   "反向选择(&I)"
      End
   End
   Begin VB.Menu mnuView 
      Caption         =   "查看(&V)"
      Begin VB.Menu mnuViewTB 
         Caption         =   "工具栏"
         Checked         =   -1  'True
      End
      Begin VB.Menu mnuFileSB 
         Caption         =   "状态栏"
         Checked         =   -1  'True
      End
      Begin VB.Menu mnuViewLine0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuViewLi 
         Caption         =   "大图标"
      End
      Begin VB.Menu mnuViewSi 
         Caption         =   "小图标"
      End
      Begin VB.Menu mnuViewList 
         Caption         =   "列表"
      End
      Begin VB.Menu mnuViewDetail 
         Caption         =   "详细资料"
      End
      Begin VB.Menu mnuViewLine1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuViewRf 
         Caption         =   "刷新(&R)"
         Shortcut        =   {F5}
      End
      Begin VB.Menu mnuViewLine2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuViewUp 
         Caption         =   "上一级"
      End
   End
   Begin VB.Menu mnuPop 
      Caption         =   ""
      Begin VB.Menu mnuFileOpenpop 
         Caption         =   "打开(&O)"
      End
      Begin VB.Menu mnuFileCreatepop 
         Caption         =   "新建(&N)"
         Begin VB.Menu mnuFileFldrpop 
            Caption         =   "文件夹"
         End
         Begin VB.Menu mnuFileTxtpop 
            Caption         =   "文本文件"
         End
      End
      Begin VB.Menu mnuFileLine0pop 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileAttrpop 
         Caption         =   "属性(&R)..."
      End
      Begin VB.Menu mnuFileLine1pop 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditCopypop 
         Caption         =   "复制(&C)"
      End
      Begin VB.Menu mnuEditCutpop 
         Caption         =   "剪切(&T)"
      End
      Begin VB.Menu mnuEditPastepop 
         Caption         =   "粘贴(&P)"
      End
      Begin VB.Menu mnuEditLine2pop 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditDelpop 
         Caption         =   "删除(&D)"
      End
      Begin VB.Menu mnuEditLine3pop 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditReNpop 
         Caption         =   "重命名(&R)"
      End
      Begin VB.Menu mnuEditLine4pop 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditSelAllpop 
         Caption         =   "全选(&A)"
      End
      Begin VB.Menu mnuFileSelRpop 
         Caption         =   "反向选择(&I)"
      End
      Begin VB.Menu mnuLine1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuViewUppop 
         Caption         =   "上一级"
      End
   End
End
Attribute VB_Name = "frmFile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private m_sngtvwWidth As Single
'判断边界的移动
Private m_bMove As Boolean

Private m_lItems As ListItems

'判断ListItem的双击
Private m_sngtmDClk As Single
Private m_bFClk As Boolean

'当前Node
Private m_ndCur As Node

'谁得焦点
Private m_bFocus As Boolean

'复制、剪切
Private m_bCopy As Boolean
Private m_arrayflPath() As String
Private m_arrayfldrPath() As String

'动画
Private m_bStop As Boolean


Private Sub clbForm_HeightChanged(ByVal NewHeight As Single)
    PlayOut
End Sub

Private Sub Form_Load()
    m_sngtvwWidth = frmFile.ScaleWidth / 3
    m_bMove = False
    m_bFClk = False
    m_bBak = False
    'treeview得焦点
    m_bFocus = True
    
    m_bStop = False
    
    Dim m_arrayflPath(1) As String
    Dim m_arrayfldrPath(1) As String
    
    m_arrayflPath(0) = ""
    m_arrayfldrPath(0) = ""
    
    ReadDir
    
    lvwFile.ColumnHeaders.Add , "Name", "名称", lvwFile.Width * 2
    lvwFile.ColumnHeaders.Add , "Size", "大小", lvwFile.Width
    lvwFile.ColumnHeaders.Add , "Type", "类型", lvwFile.Width
    lvwFile.ColumnHeaders.Add , "MDate", "修改时间", lvwFile.Width * 2
   
    lvwFile.View = lvwReport
    
    tvwFile.Nodes("C:\").Selected = True
    ImageCombo1_Dropdown

    tvwFile_NodeClick tvwFile.Nodes("C:\")
    tvwFile.Nodes("C:\").Expanded = True
    tvwFile.Nodes("C:\").Selected = True
    
    '保存当前node
    Set m_ndCur = tvwFile.Nodes("C:\")
    
    
End Sub

'读出文件系统出来,放于TreeView中
Private Sub ReadDir()
    '图像索引号
    Dim intimgindex As Integer
    '父节点
    Dim strParent As String
    
    Dim nd As Node
    
     '创建文件系统对象
    Set fso = CreateObject("scripting.filesystemobject")
    Set drvs = fso.Drives
    
    Set nd = tvwFile.Nodes.Add(, 0, "desktop", "桌面", 1, 1)
    nd.Tag = 4
    Set nd = tvwFile.Nodes.Add("desktop", 4, "mycomp", "我的电脑", 2, 2)
    nd.Tag = 3
    
    For Each drv In drvs
        Select Case drv.DriveType
        Case CDRom
            intimgindex = 5
        Case RamDisk
            intimgindex = 4
        Case Removable
            intimgindex = 3
        Case Network
            intimgindex = 9
        Case Unknown
            intimgindex = 4
        Case Fixed
            intimgindex = 4
        End Select
        If drv.DriveType = Fixed Then
            Set nd = tvwFile.Nodes.Add("mycomp", 4, drv.path, drv.DriveLetter + "(" + drv.VolumeName + ")", intimgindex, intimgindex)
        Else

⌨️ 快捷键说明

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