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

📄 form2.frm

📁 100个vb编程实例,什么都有
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form2 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "制作MP3列表文件"
   ClientHeight    =   2925
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5610
   Icon            =   "Form2.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2925
   ScaleWidth      =   5610
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "全部选中"
      Height          =   285
      Left            =   2760
      TabIndex        =   10
      Top             =   60
      Width           =   945
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   405
      Left            =   0
      TabIndex        =   9
      Top             =   2520
      Width           =   5610
      _ExtentX        =   9895
      _ExtentY        =   714
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   3
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   6
            Alignment       =   1
            AutoSize        =   2
            Object.Width           =   1588
            MinWidth        =   1587
            TextSave        =   "2001-5-8"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            Alignment       =   1
            Object.Width           =   1587
            MinWidth        =   1587
            TextSave        =   "11:57"
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Object.Width           =   6615
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton Command4 
      Caption         =   "退    出"
      Height          =   285
      Left            =   4590
      TabIndex        =   8
      ToolTipText     =   "退出程序"
      Top             =   60
      Width           =   945
   End
   Begin VB.CommandButton Command3 
      Caption         =   "保存文件"
      Height          =   285
      Left            =   3690
      TabIndex        =   7
      ToolTipText     =   "将选择的MP3文件保存为列表文件(smplay.m3u)"
      Top             =   60
      Width           =   945
   End
   Begin VB.CommandButton Command1 
      Caption         =   "搜索文件"
      Height          =   285
      Left            =   1830
      TabIndex        =   6
      ToolTipText     =   "搜索当前驱动器中所有的MP3文件"
      Top             =   60
      Width           =   945
   End
   Begin VB.DriveListBox Drive1 
      BackColor       =   &H00FFC0C0&
      Height          =   300
      Left            =   120
      TabIndex        =   2
      ToolTipText     =   "选择MP3文件所在的驱动器"
      Top             =   60
      Width           =   1665
   End
   Begin VB.FileListBox File1 
      Height          =   450
      Left            =   3840
      Pattern         =   "*.mp3"
      TabIndex        =   4
      Top             =   750
      Visible         =   0   'False
      Width           =   1245
   End
   Begin VB.DirListBox Dir1 
      Height          =   510
      Left            =   3840
      TabIndex        =   3
      Top             =   1290
      Visible         =   0   'False
      Width           =   1245
   End
   Begin VB.ListBox SubDir 
      Height          =   420
      Left            =   3840
      TabIndex        =   0
      Top             =   1890
      Visible         =   0   'False
      Width           =   1245
   End
   Begin VB.ListBox List1 
      BackColor       =   &H00C0E0FF&
      Columns         =   2
      Height          =   1860
      Left            =   120
      MultiSelect     =   2  'Extended
      TabIndex        =   1
      Top             =   570
      Width           =   5355
   End
   Begin VB.Frame Frame1 
      Height          =   2115
      Left            =   30
      TabIndex        =   5
      Top             =   390
      Width           =   5535
      Begin VB.Line Line1 
         BorderColor     =   &H00FFFFFF&
         X1              =   30
         X2              =   5520
         Y1              =   30
         Y2              =   30
      End
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
   On Error GoTo Drive_er
    List1.Clear
    SubDir.Clear
    Dir1.Path = Left$(Drive1.Drive, 2) + "\"
    File1.Path = Dir1.Path
    For T& = 0 To File1.ListCount - 1
      List1.AddItem Dir1.Path + File1.List(T&)
      StatusBar1.Panels(3).Text = Dir1.Path + "\" + File1.List(T&)
      Next
    For T& = 0 To Dir1.ListCount - 1
      SubDir.AddItem Dir1.List(T&)
    Next
    If T& = 0 Then GoTo FiniShedPoint
      Cnt& = 0
StartPoint:
      Dir1.Path = SubDir.List(Cnt&)
      File1.Path = Dir1.Path
    For T& = 0 To Dir1.ListCount - 1
      SubDir.AddItem Dir1.List(T&)
    Next
    For T& = 0 To File1.ListCount - 1
      List1.AddItem Dir1.Path + "\" + File1.List(T&)
      StatusBar1.Panels(3).Text = Dir1.Path + "\" + File1.List(T&)
    Next
    Cnt& = Cnt& + 1
    If Cnt& < SubDir.ListCount Then GoTo StartPoint
FiniShedPoint:
      StatusBar1.Panels(3).Text = "搜索完成!共找到" + Str$(List1.ListCount) + " 个MP3文件"
Drive_er:
    If (Err = 68) Or (Err = 71) Then
        StatusBar1.Panels(3).Text = "驱动器 " & UCase(Drive1.Drive) & " 未准备好!"
    Else
        Exit Sub
    End If
End Sub

Private Sub Command2_Click()
Dim I As Integer
For I = 0 To List1.ListCount - 1
  List1.Selected(I) = True
Next
End Sub

Private Sub Command3_Click()
  Dim Num As Integer
    Dim FName As String
    Dim FNum As Integer
    Dim I As Integer
    FNum = FreeFile
    On Error GoTo ERRList
    Open "SmPlay.m3u" For Append As #FNum
    For I = 0 To List1.ListCount - 1
      If List1.Selected(I) Then
        FName = List1.List(I)
        Print #FNum, FName
      End If
    Next
    Close #FNum
    StatusBar1.Panels(3).Text = "保存MP3列表文件完成!"
    Exit Sub
ERRList:
    StatusBar1.Panels(3).Text = "列表文件正在使用,无法保存!"
    Exit Sub
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

⌨️ 快捷键说明

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