VERSION 5.00
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "MSDXM.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   5220
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5205
   LinkTopic       =   "Form1"
   ScaleHeight     =   5220
   ScaleWidth      =   5205
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "退出"
      Height          =   420
      Left            =   4080
      TabIndex        =   4
      Top             =   4665
      Width           =   900
   End
   Begin VB.CommandButton Command3 
      Caption         =   "全屏"
      Height          =   405
      Left            =   2760
      TabIndex        =   3
      Top             =   4665
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "播放"
      Height          =   405
      Left            =   1485
      TabIndex        =   2
      Top             =   4650
      Width           =   960
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开"
      Height          =   450
      Left            =   270
      TabIndex        =   1
      Top             =   4605
      Width           =   885
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   2805
      Top             =   4095
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin MediaPlayerCtl.MediaPlayer MediaPlayer1 
      Height          =   4275
      Left            =   255
      TabIndex        =   0
      Top             =   90
      Width           =   4755
      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 Command1_Click()
    CommonDialog1.ShowOpen      '显示[打开]文件对话框
    MediaPlayer1.FileName = CommonDialog1.FileName  '设置播放文件的路径
    
End Sub

Private Sub Command2_Click()
    MediaPlayer1.Play       '播放影片
End Sub

Private Sub Command3_Click()
    If MediaPlayer1.PlayState = mpPlaying Then  '检测影片是否正在播放
        MediaPlayer1.DisplaySize = mpFullScreen     '将正在播放的影片放大到全屏
    Else
        MsgBox "请先播放影片!"
    End If
End Sub

Private Sub Command4_Click()
    End
End Sub

Private Sub Form_Load()
    '设置可播放的文件类型
    CommonDialog1.Filter = "windows 视频文件(*.avi)|*.avi|电影文件 (*.mpg;*.mpeg) |*.mpg;*.mpeg|Windows 流媒体(*.asf)|*.asf|mp3(*.mp3;*.m3u)|*.mp3;*.m3u| QuickTime (*.mov) |*.mov|所有文件(*.*)|*.*"
End Sub
