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

📄 frmdaoru.frm

📁 教学资源管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmDaoru 
   BackColor       =   &H00F6F6F6&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "导入设置"
   ClientHeight    =   5820
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   11145
   ClipControls    =   0   'False
   Icon            =   "frmDaoru.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5820
   ScaleWidth      =   11145
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin MSComctlLib.ListView ListView1 
      Height          =   1575
      Left            =   6360
      TabIndex        =   21
      Top             =   4200
      Width           =   4575
      _ExtentX        =   8070
      _ExtentY        =   2778
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      HideColumnHeaders=   -1  'True
      OLEDragMode     =   1
      OLEDropMode     =   1
      Checkboxes      =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Appearance      =   0
      OLEDragMode     =   1
      OLEDropMode     =   1
      NumItems        =   1
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Object.Width           =   8070
      EndProperty
   End
   Begin MSComctlLib.TreeView TreeView1 
      Height          =   3255
      Left            =   6360
      TabIndex        =   20
      Top             =   480
      Width           =   4575
      _ExtentX        =   8070
      _ExtentY        =   5741
      _Version        =   393217
      HideSelection   =   0   'False
      LabelEdit       =   1
      LineStyle       =   1
      Style           =   7
      Checkboxes      =   -1  'True
      Appearance      =   0
      OLEDragMode     =   1
      OLEDropMode     =   1
   End
   Begin VB.ComboBox cmbGongju 
      Appearance      =   0  'Flat
      BackColor       =   &H8000000E&
      ForeColor       =   &H80000007&
      Height          =   300
      ItemData        =   "frmDaoru.frx":3A8A
      Left            =   1080
      List            =   "frmDaoru.frx":3ACD
      TabIndex        =   17
      Top             =   3840
      Width           =   4815
   End
   Begin VB.ComboBox cmbKemu 
      Appearance      =   0  'Flat
      BackColor       =   &H8000000E&
      ForeColor       =   &H80000007&
      Height          =   300
      ItemData        =   "frmDaoru.frx":3C57
      Left            =   840
      List            =   "frmDaoru.frx":3C8E
      Style           =   2  'Dropdown List
      TabIndex        =   16
      Top             =   840
      Width           =   1815
   End
   Begin VB.TextBox txtZuozhe 
      Appearance      =   0  'Flat
      Height          =   270
      Left            =   840
      TabIndex        =   15
      Top             =   1440
      Width           =   2175
   End
   Begin VB.TextBox txtJieshao 
      Appearance      =   0  'Flat
      Height          =   975
      Left            =   840
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   14
      Top             =   2520
      Width           =   5055
   End
   Begin VB.TextBox txtTitle 
      Appearance      =   0  'Flat
      Height          =   270
      Left            =   840
      TabIndex        =   8
      Top             =   2040
      Width           =   5055
   End
   Begin VB.ComboBox cmbNianji 
      Appearance      =   0  'Flat
      BackColor       =   &H8000000E&
      ForeColor       =   &H80000007&
      Height          =   300
      ItemData        =   "frmDaoru.frx":3D04
      Left            =   4080
      List            =   "frmDaoru.frx":3D56
      Style           =   2  'Dropdown List
      TabIndex        =   6
      Top             =   240
      Width           =   1815
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   3960
      TabIndex        =   1
      Top             =   5160
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   1560
      TabIndex        =   0
      Top             =   5160
      Width           =   1215
   End
   Begin VB.Label Label8 
      BackColor       =   &H00F6F6F6&
      Caption         =   "科 目:"
      Height          =   255
      Left            =   120
      TabIndex        =   23
      Top             =   840
      Width           =   855
   End
   Begin VB.Label Label11 
      BackColor       =   &H00F6F6F6&
      Caption         =   "相关文件:"
      Height          =   255
      Left            =   6360
      TabIndex        =   22
      Top             =   3960
      Width           =   3615
   End
   Begin VB.Label Label10 
      BackColor       =   &H00F6F6F6&
      Caption         =   "选择相关文件:"
      Height          =   255
      Left            =   6360
      TabIndex        =   19
      Top             =   240
      Width           =   3615
   End
   Begin VB.Label Label9 
      BackColor       =   &H00F6F6F6&
      Caption         =   "开发工具:"
      Height          =   255
      Left            =   120
      TabIndex        =   18
      Top             =   3870
      Width           =   1095
   End
   Begin VB.Label labType 
      BackColor       =   &H00F6F6F6&
      Height          =   255
      Left            =   840
      TabIndex        =   13
      Top             =   240
      Width           =   2055
   End
   Begin VB.Label Label7 
      BackColor       =   &H00F6F6F6&
      Caption         =   "介  绍:"
      Height          =   255
      Left            =   120
      TabIndex        =   12
      Top             =   2760
      Width           =   735
   End
   Begin VB.Label Label6 
      BackColor       =   &H00F6F6F6&
      Caption         =   "作  者:"
      Height          =   255
      Left            =   120
      TabIndex        =   11
      Top             =   1440
      Width           =   735
   End
   Begin VB.Label labFileSize 
      BackColor       =   &H00F6F6F6&
      Height          =   255
      Left            =   3960
      TabIndex        =   10
      Top             =   840
      Width           =   1215
   End
   Begin VB.Label Label5 
      BackColor       =   &H00F6F6F6&
      Caption         =   "大  小:"
      Height          =   255
      Left            =   3120
      TabIndex        =   9
      Top             =   840
      Width           =   1095
   End
   Begin VB.Label Label4 
      BackColor       =   &H00F6F6F6&
      Caption         =   "标  题:"
      Height          =   255
      Left            =   120
      TabIndex        =   7
      Top             =   2040
      Width           =   735
   End
   Begin VB.Label Label3 
      BackColor       =   &H00F6F6F6&
      Caption         =   "年  级:"
      Height          =   255
      Left            =   3120
      TabIndex        =   5
      Top             =   240
      Width           =   855
   End
   Begin VB.Label Label2 
      BackColor       =   &H00F6F6F6&
      Caption         =   "类  型:"
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   240
      Width           =   735
   End
   Begin VB.Label labFile 
      BackColor       =   &H00F6F6F6&
      Height          =   255
      Left            =   1200
      TabIndex        =   3
      Top             =   4560
      Width           =   4815
   End
   Begin VB.Label Label1 
      BackColor       =   &H00F6F6F6&
      Caption         =   "原文件路径:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   4560
      Width           =   1215
   End
End
Attribute VB_Name = "frmDaoru"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OK As Boolean
Private Sub Command2_Click()
    OK = False
    Me.Hide
End Sub

Private Sub Command1_Click()
    If Trim(Me.cmbNianji.Text) = "" Then
        MsgBox "年级不能为空!", , "提示"
        Me.cmbNianji.SetFocus
        Exit Sub
    End If
    If Trim(Me.cmbKemu.Text) = "" Then
        MsgBox "科目不能为空!", , "提示"
        Me.cmbKemu.SetFocus
        Exit Sub
    End If
    If Trim(Me.txtTitle.Text) = "" Then
        MsgBox "标题不能为空!", , "提示"
        Me.txtTitle.SetFocus
        Exit Sub
    End If
    OK = True
    Me.Hide
End Sub

Private Sub Form_Load()
    OK = False
End Sub

Private Sub Form_Resize()
    Dim str As String
    str = FileDir(labFile.Caption)
    TreeView1.Nodes.Add , , str, str
    uFindFile str, str
    TreeView1.Nodes(str).Expanded = True
End Sub
Private Function uFindFile(ByVal ustrDir As String, ByVal uKey As String) As String
    Dim Win_Find As WIN32_FIND_DATA
    Dim strFileName As String
    Dim hFindFile As Long, se As Long
    Dim thisKey As String
    hFindFile = FindFirstFile(ustrDir + "*.*", Win_Find)
    
    
    If hFindFile <> -1 Then
        se = 1
        While se <> 0
            strFileName = ustr(Win_Find.cFileName)
            If thisKey = "" Then
                 If (Int(Win_Find.dwFileAttributes / 16) Mod 2 = 1) And (Int(Win_Find.dwFileAttributes / 4) Mod 2 = 0) And strFileName <> "." And strFileName <> ".." Then
                     thisKey = ustrDir + strFileName + "\"
                     TreeView1.Nodes.Add uKey, tvwChild, thisKey, strFileName + "\"
                     TreeView1.Nodes.Add thisKey, tvwChild, ""
                 End If
            
                 If Int(Win_Find.dwFileAttributes / 16) Mod 2 = 0 And (Int(Win_Find.dwFileAttributes / 4) Mod 2 = 0) Then
                     thisKey = ustrDir + strFileName
                     TreeView1.Nodes.Add uKey, tvwChild, thisKey, strFileName
                
                 End If
            Else
                strFileName = ustr(Win_Find.cFileName)
                If (Int(Win_Find.dwFileAttributes / 16) Mod 2 = 1) And (Int(Win_Find.dwFileAttributes / 4) Mod 2 = 0) And strFileName <> "." And strFileName <> ".." Then
              
                    TreeView1.Nodes.Add thisKey, tvwFirst, ustrDir + strFileName + "\", strFileName + "\"
                    TreeView1.Nodes.Add ustrDir + strFileName + "\", tvwChild, ""
                End If
            
                If Int(Win_Find.dwFileAttributes / 16) Mod 2 = 0 And (Int(Win_Find.dwFileAttributes / 4) Mod 2 = 0) Then
                
                        TreeView1.Nodes.Add thisKey, tvwLast, ustrDir + strFileName, strFileName
                
                End If
            End If
            se = FindNextFile(hFindFile, Win_Find)
            DoEvents
        Wend
        FindClose hFindFile
    End If
End Function
Private Function ustr(ByVal Mystr As String) As String
    Dim i As Integer
    i = 1
    While Mid(Mystr, i, 1) <> Chr(0)
        i = i + 1
    Wend
    ustr = Left(Mystr, i - 1)
End Function
Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
If Node.Child.Text = "" Then
    Dim MyNode As MSComctlLib.Node
    Dim str As String
    Set MyNode = Node
    While Not (MyNode Is Nothing)
        str = MyNode.Text + str
        Set MyNode = MyNode.Parent
    Wend
    TreeView1.Nodes.Remove Node.Child.Index
    uFindFile str, str
End If
End Sub
Private Sub TreeView1_NodeCheck(ByVal Node As MSComctlLib.Node)
    Dim MyNode As MSComctlLib.Node
    Dim MyItem As MSComctlLib.ListItem
    Dim str As String
    Dim i As Integer
    Set MyNode = Node
    While Not (MyNode Is Nothing)
        str = MyNode.Text + str
        Set MyNode = MyNode.Parent
    Wend
    If Node.Checked Then
        Set MyItem = ListView1.FindItem(str)
        If MyItem Is Nothing Then
            i = ListView1.ListItems.Count
            ListView1.ListItems.Add , "Key" + CStr(i), str
            ListView1.ListItems("Key" + CStr(i)).Checked = True
        Else
             MyItem.Checked = True
        End If
    Else
        Set MyItem = ListView1.FindItem(str)
        If Not (MyItem Is Nothing) Then MyItem.Checked = False
    End If
End Sub

⌨️ 快捷键说明

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