📄 frmmusic.frm
字号:
VERSION 5.00
Object = "{6BF52A50-394A-11D3-B153-00C04F79FAA6}#1.0#0"; "wmp.dll"
Begin VB.Form frmMusic
AutoRedraw = -1 'True
BackColor = &H00FFFFFF&
BorderStyle = 5 'Sizable ToolWindow
Caption = "音乐夹"
ClientHeight = 4095
ClientLeft = 7410
ClientTop = 6135
ClientWidth = 4695
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4095
ScaleWidth = 4695
ShowInTaskbar = 0 'False
Begin VB.ListBox listMusic
BackColor = &H00FFFFFF&
Height = 3120
Left = 0
TabIndex = 1
Top = 0
Width = 4695
End
Begin WMPLibCtl.WindowsMediaPlayer WMP
Height = 975
Left = 0
TabIndex = 0
Top = 3120
Width = 4695
URL = ""
rate = 1
balance = 0
currentPosition = 0
defaultFrame = ""
playCount = 1
autoStart = -1 'True
currentMarker = 0
invokeURLs = -1 'True
baseURL = ""
volume = 50
mute = 0 'False
uiMode = "full"
stretchToFit = 0 'False
windowlessVideo = 0 'False
enabled = -1 'True
enableContextMenu= -1 'True
fullScreen = 0 'False
SAMIStyle = ""
SAMILang = ""
SAMIFilename = ""
captioningID = ""
enableErrorDialogs= 0 'False
_cx = 8281
_cy = 1720
End
End
Attribute VB_Name = "frmMusic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public boolAddMusic As Boolean
Private Sub Form_Load()
Dim i As Integer
WMP.currentPlaylist = WMP.playlistCollection.getByName("刷新曲目").Item(0)
WMP.currentPlaylist.Clear
If WMP.currentPlaylist.Count Then '检测当前播放列表是否存在文件,存在则相应地将文件列表写入frmMusic窗体listMusic控件
For i = 1 To WMP.currentPlaylist.Count
frmMusic.listMusic.AddItem WMP.currentPlaylist.Item(i - 1).Name
Next i
End If
End Sub
Private Sub listMusic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu frmMenu.mnuMusic '弹出菜单
End If
End Sub
Private Sub listMusic_DblClick() '播放选定文件
Dim i As Integer
Dim meCurrmedia As IWMPMedia
Set meCurrmedia = frmMusic.WMP.currentPlaylist.Item(frmMusic.listMusic.ListIndex) '获得选定Media文件
frmMusic.WMP.Controls.currentItem = meCurrmedia '更改当前Media文件
frmMusic.WMP.Controls.play '播放
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -