主题:[讨论]关于vb的WindowsMediaPlayer使用啊
Option Explicit
Dim OldWidth, OldHeight As Integer
Private Sub Command1_Click()
Dim filename As String
CommonDialog1.ShowOpen
filename = CommonDialog1.filename ' 指定播放路径
WindowsMediaPlayer1.URL = filename
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
WindowsMediaPlayer1.fullScreen = True '全屏
End Sub
Private Sub Form_Load()
CommonDialog1.Filter = "影音文件(*.avi;*.mpg;*.asf;*.wmv;*.RMVB)|*.avi;*mpg;*.asf;*.wmv;*.RMVB|all files(*.*)|*.*"
End Sub
Private Sub Timer1_Timer()
If Form1.Width <> OldWidth Or Form1.Height <> OldHeight Then
WindowsMediaPlayer1.Width = Form1.Width - 100
WindowsMediaPlayer1.Height = Form1.Height - 1100
OldWidth = Form1.Width
OldHeight = Form1.Height
End If
End Sub
为什么我做的只能播放mwv格式的电影。rmvb播放不了。。。。大家帮我看下上面的代码有什么错误啊
Dim OldWidth, OldHeight As Integer
Private Sub Command1_Click()
Dim filename As String
CommonDialog1.ShowOpen
filename = CommonDialog1.filename ' 指定播放路径
WindowsMediaPlayer1.URL = filename
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
WindowsMediaPlayer1.fullScreen = True '全屏
End Sub
Private Sub Form_Load()
CommonDialog1.Filter = "影音文件(*.avi;*.mpg;*.asf;*.wmv;*.RMVB)|*.avi;*mpg;*.asf;*.wmv;*.RMVB|all files(*.*)|*.*"
End Sub
Private Sub Timer1_Timer()
If Form1.Width <> OldWidth Or Form1.Height <> OldHeight Then
WindowsMediaPlayer1.Width = Form1.Width - 100
WindowsMediaPlayer1.Height = Form1.Height - 1100
OldWidth = Form1.Width
OldHeight = Form1.Height
End If
End Sub
为什么我做的只能播放mwv格式的电影。rmvb播放不了。。。。大家帮我看下上面的代码有什么错误啊