📄 form1.frm
字号:
VERSION 5.00
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "msdxm.ocx"
Begin VB.Form form1
Caption = "可连续播放的MP3播放器"
ClientHeight = 4665
ClientLeft = 1125
ClientTop = 1500
ClientWidth = 4620
LinkTopic = "Form1"
ScaleHeight = 4665
ScaleWidth = 4620
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command1
Caption = "退出"
Height = 375
Left = 2325
TabIndex = 8
Top = 4245
Width = 2190
End
Begin VB.ListBox List1
Height = 2760
Left = 2340
TabIndex = 4
Top = 1425
Width = 2175
End
Begin VB.TextBox Text1
Height = 270
Left = 1140
TabIndex = 3
Top = 780
Width = 3375
End
Begin VB.DirListBox Dir1
Height = 1140
Left = 75
TabIndex = 2
Top = 1500
Width = 2175
End
Begin VB.FileListBox File1
Height = 1890
Left = 60
Pattern = "*.mp3"
TabIndex = 1
Top = 2700
Width = 2175
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 60
TabIndex = 0
Top = 1140
Width = 2175
End
Begin VB.Label Label2
Caption = "播放曲目列表"
Height = 375
Left = 2340
TabIndex = 7
Top = 1170
Width = 2175
End
Begin VB.Label Label1
Caption = "播放曲目"
Height = 255
Left = 180
TabIndex = 6
Top = 780
Width = 855
End
Begin MediaPlayerCtl.MediaPlayer MediaPlayer1
Height = 615
Left = 60
TabIndex = 5
Top = 60
Width = 4455
AudioStream = -1
AutoSize = 0 'False
AutoStart = -1 'True
AnimationAtStart= -1 'True
AllowScan = -1 'True
AllowChangeDisplaySize= -1 'True
AutoRewind = 0 'False
Balance = 0
BaseURL = ""
BufferingTime = 5
CaptioningID = ""
ClickToPlay = -1 'True
CursorType = 0
CurrentPosition = -1
CurrentMarker = 0
DefaultFrame = ""
DisplayBackColor= 0
DisplayForeColor= 16777215
DisplayMode = 0
DisplaySize = 4
Enabled = -1 'True
EnableContextMenu= -1 'True
EnablePositionControls= -1 'True
EnableFullScreenControls= 0 'False
EnableTracker = -1 'True
Filename = ""
InvokeURLs = -1 'True
Language = -1
Mute = 0 'False
PlayCount = 1
PreviewMode = 0 'False
Rate = 1
SAMILang = ""
SAMIStyle = ""
SAMIFileName = ""
SelectionStart = -1
SelectionEnd = -1
SendOpenStateChangeEvents= -1 'True
SendWarningEvents= -1 'True
SendErrorEvents = -1 'True
SendKeyboardEvents= 0 'False
SendMouseClickEvents= 0 'False
SendMouseMoveEvents= 0 'False
SendPlayStateChangeEvents= -1 'True
ShowCaptioning = 0 'False
ShowControls = -1 'True
ShowAudioControls= -1 'True
ShowDisplay = 0 'False
ShowGotoBar = 0 'False
ShowPositionControls= -1 'True
ShowStatusBar = 0 'False
ShowTracker = -1 'True
TransparentAtStart= 0 'False
VideoBorderWidth= 0
VideoBorderColor= 0
VideoBorder3D = 0 'False
Volume = -600
WindowlessVideo = 0 'False
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
If List1.ListCount = 0 Then
List1.AddItem Dir1.Path & "\" & File1.FileName '增加曲目到列表中
List1.ListIndex = 0
MediaPlayer1.FileName = List1.Text '设置播放曲目
MediaPlayer1.AutoStart = True
Else
List1.AddItem Dir1.Path & "\" & File1.FileName '增加曲目到列表中
End If
End Sub
Private Sub List1_Click()
Text1.Text = List1.Text
End Sub
Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long)
'自动循环播放
If MediaPlayer1.PlayState = mpStopped Then
If List1.ListIndex < List1.ListCount - 1 Then
List1.ListIndex = List1.ListIndex + 1
MediaPlayer1.FileName = List1.Text
MediaPlayer1.AutoStart = True
End If
End If
End Sub
Private Sub Command1_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -