【VB开源代码栏目提醒】:以下是网学会员为您推荐的VB开源代码-MP3Player.frm,希望本篇文章对您学习有所帮助。
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "msdxm.ocx"
Begin VB.Form Form1
BackColor = &H80000006&
BorderStyle = 0 'None
Caption = "MP3 Player"
ClientHeight = 750
ClientLeft = 0
ClientTop = 0
ClientWidth = 2625
Icon = "MP3 Player.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 750
ScaleWidth = 2625
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame mp3
BackColor = &H80000007&
Caption = "MP3播放器"
ForeColor = &H8000000E&
Height = 615
Left = 120
TabIndex = 0
Top = 0
Width = 2415
Begin VB.CommandButton cmdOpen
Caption = "Open"
Height = 255
Left = 600
TabIndex = 4
Top = 240
Width = 615
End
Begin VB.CommandButton cmdPlay
Caption = "Play"
Height = 255
Left = 120
TabIndex = 3
Top = 240
Width = 495
End
Begin
VB.CommandButton cmdStop
Caption = "Stop"
Height = 255
Left = 1200
TabIndex = 2
Top = 240
Width = 495
End
Begin VB.CommandButton cmdExit
Caption = "Exit"
Height = 255
Left = 1680
TabIndex = 1
Top = 240
Width = 615
End
Begin MSComDlg.CommonDialog cdlGetFile
Left = 0
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MediaPlayerCtl.MediaPlayer Player
Height = 1095
Left = 600
TabIndex = 5
Top = 0
Visible = 0 'False
Width = 1575
AudioStream = -1
AutoSize = 0 'False
AutoStart = 0 'False
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
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdOpen_Click()
Dim stFileName As String
cdlGetFile.Filter = "MP3 Files|*.MP3"
cdlGetFile.Flags = cdlOFNHideReadOnly
cdlGetFile.InitDir = "C:\Windows\Desktop\"
cdlGetFile.ShowOpen
stFileName = cdlGetFile.FileName
Player.Open stFileName
End Sub
Private Sub cmdPlay_Click()
Player.Play
End Sub
Private Sub cmdStop_Click()
Player.Stop
End Sub