vb中.将WindowsMediaPlayer控件的状态显示在text中。。。。。。。。
展开全部
我这里有一个做测试的例子,属必理显示在label上面的。
Private
Sub
Form_Load()
WindowsMediaPlayer1.enableContextMenu
=
False
End
Sub
Private
Sub
Slider1_Scroll()
WindowsMediaPlayer1.settings.volume
=
Slider1.Value
End
Sub
Private
Sub
Timer1_Timer()
Label3.Caption
=
WindowsMediaPlayer1.Controls.currentPositionString
If
WindowsMediaPlayer1.playState
=
3
Then
Label1.Caption
=
"/"
&
WindowsMediaPlayer1.currentMedia.durationString
Label2.Caption
=
"文件大小:"
&
Round(WindowsMediaPlayer1.currentMedia.getItemInfo("filesize")
/
1024
^
2,
2)
&
"M"
Label3.Caption
=
WindowsMediaPlayer1.Controls.currentPositionString
Label5.Caption
=
"歌曲名:"
&
WindowsMediaPlayer1.currentMedia.getItemInfo("title")
Slider1.Value
=
WindowsMediaPlayer1.settings.volume
End
If
End
Sub
Private
Sub
Timer2_Timer()
Static
i
As
Integer
Label7.Left
=
Label7.Left
-
10
End
Sub
下面是图:
黑色的是WMP,下面的label名自己稍做更改。我把源码发你QQ邮箱去了。
Private
Sub
Form_Load()
WindowsMediaPlayer1.enableContextMenu
=
False
End
Sub
Private
Sub
Slider1_Scroll()
WindowsMediaPlayer1.settings.volume
=
Slider1.Value
End
Sub
Private
Sub
Timer1_Timer()
Label3.Caption
=
WindowsMediaPlayer1.Controls.currentPositionString
If
WindowsMediaPlayer1.playState
=
3
Then
Label1.Caption
=
"/"
&
WindowsMediaPlayer1.currentMedia.durationString
Label2.Caption
=
"文件大小:"
&
Round(WindowsMediaPlayer1.currentMedia.getItemInfo("filesize")
/
1024
^
2,
2)
&
"M"
Label3.Caption
=
WindowsMediaPlayer1.Controls.currentPositionString
Label5.Caption
=
"歌曲名:"
&
WindowsMediaPlayer1.currentMedia.getItemInfo("title")
Slider1.Value
=
WindowsMediaPlayer1.settings.volume
End
If
End
Sub
Private
Sub
Timer2_Timer()
Static
i
As
Integer
Label7.Left
=
Label7.Left
-
10
End
Sub
下面是图:
黑色的是WMP,下面的label名自己稍做更改。我把源码发你QQ邮箱去了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询