📄 form1.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "播放列表"
ClientHeight = 1290
ClientLeft = 150
ClientTop = 435
ClientWidth = 5385
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1290
ScaleWidth = 5385
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CommonDialog1
Left = 2160
Top = 1200
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1
Left = 2520
Top = 720
End
Begin MSComDlg.CommonDialog CommonDialog2
Left = 1320
Top = 600
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.ListBox List1
BackColor = &H00000000&
ForeColor = &H00FFFF00&
Height = 1320
Left = 0
TabIndex = 0
Top = 0
Width = 5415
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub OpenM3u()
Dim AllLines As New Collection
Dim CurrentLine As Long
Dim nextLine As String
Dim InFile As Integer
InFile = FreeFile
Open sF For Input As InFile
While Not EOF(InFile)
Line Input #InFile, nextLine
AllLines.add nextLine
Wend
Close InFile
Dim i As Integer
For i = 0 To AllLines.Count - 1
CurrentLine = CurrentLine + 1
If AllLines.Count < CurrentLine Then
CurrentLine = 1
End If
If AllLines.Count > 0 Then
Form1.List1.AddItem AllLines.item(CurrentLine)
End If
Next i
Form2.MMControl1.FileName = Form1.List1.List(0)
Form1.List1.ListIndex = 0
Exit Sub
End Sub
Private Sub Form_Activate()
'Form1.List1.Selected(0) = True
'If List1.List(0) <> "" Then
' Else
' MsgBox "系统还没有选取任何歌曲!", , "蓝霞技术"
' End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Form1.hWnd, WM_SYSCOMMAND, SC_MOVE, 0
End Sub
Private Sub List1_DblClick()
On Error Resume Next
Form2.MMControl1.Command = "close"
Form2.MMControl1.DeviceType = "MpegVideo"
'MMControl1.FileName = List1.List(List1.Selected)
Form4.Show
Form2.MMControl1.hWndDisplay = Form4.Picture1.hWnd
Form2.MMControl1.FileName = Form1.List1.List(Form1.List1.ListIndex)
Form2.MMControl1.Command = "open"
Form2.MMControl1.Command = "play"
Form2.MMControl1.Command = "play"
Form2.MMControl1.TimeFormat = 2
'mmcontrol1.FileName =
Form2.Slider2.Min = 0
Form2.Slider2.Max = MMControl1.Length
Form2.Picture3.BackColor = &HFF&
Form4.Caption = "正在播放 " + MMControl1.FileName
Form2.Label9.Caption = "状态:播放..."
Form2.f12.Enabled = True
Form2.f11.Enabled = False
Form2.f32.Enabled = True
Form2.f22.Enabled = True
Form2.f23.Enabled = True
Form2.f25.Enabled = True
Form2.f26.Enabled = True
Form2.f28.Enabled = True
Form2.f27.Enabled = True
Form2.f29.Enabled = True
Form2.f31.Enabled = True
Form2.gh.Enabled = True
Form2.Check1.Enabled = True
Form2.Check2.Enabled = True
End Sub
Private Sub sssd_Click()
Dim i As Integer
Dim b As Integer
b = List1.ListCount
For i = 0 To b - 1
If i = b Then
Exit For
End If
If List1.Selected(i) = True Then 'And Form2.MMControl1.FileName <> Form1.List1.List(i) Then
List1.RemoveItem i
List1.Selected(i) = True
i = 0
'Else
'MsgBox "这个文件正在使用,不能删除!!!", , "蓝霞技术"
' Exit For
End If
b = List1.ListCount
Next
End Sub
Private Sub tggg_Click()
List1.Clear
Form4.Hide
Form2.MMControl1.Command = "stop"
Form2.MMControl1.FileName = ""
End Sub
Private Sub Timer1_Timer()
'List1.SetFocus
End Sub
Private Sub tttt_Click()
Dim DlgInfo As DlgFileInfo
Dim i As Integer
On Error GoTo ErrHandle
With CommonDialog1
.CancelError = True
.MaxFileSize = 32767
.Flags = cdlOFNHideReadOnly Or cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNNoDereferenceLinks
.DialogTitle = "选择文件"
.Filter = "影视文件(*.Dat,*.Mpg,*.Avi,*.mov)|*.Dat;*.Mpg;*.Avi;*.mov|音频文件(*.wav,*.mp3,*.mid)|*.wav;*.MP3;*.mid|ALL File (*.*)|*.*"
.ShowOpen
DlgInfo = GetDlgSelectFileInfo(.FileName)
.FileName = ""
End With
For i = 1 To DlgInfo.iCount
Form1.List1.AddItem DlgInfo.sPath & DlgInfo.sFile(i)
Next i
Exit Sub
ErrHandle:
End Sub
Private Sub ytytyty_Click()
On Error GoTo openerr:
CommonDialog1.Filter = "(*.m3u)|*.m3u"
CommonDialog1.ShowOpen
sF = CommonDialog1.FileName
'Form1.List1.Clear
OpenM3u
Exit Sub
openerr:
'MsgBox "打不开,不是我的错,是这个文件有错!!!!"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -