📄 form1.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{C1A8AF28-1257-101B-8FB0-0020AF039CA3}#1.1#0"; "MCI32.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "关闭"
Height = 495
Left = 2040
TabIndex = 3
Top = 2160
Width = 855
End
Begin VB.CommandButton Command1
Caption = "打开"
Height = 495
Left = 600
TabIndex = 2
Top = 2160
Width = 855
End
Begin MCI.MMControl MMControl1
Height = 495
Left = 480
TabIndex = 0
Top = 1080
Width = 3540
_ExtentX = 6244
_ExtentY = 873
_Version = 393216
PlayEnabled = -1 'True
DeviceType = ""
FileName = ""
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3720
Top = 1920
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Label Label1
Height = 495
Left = 600
TabIndex = 1
Top = 240
Width = 3135
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()
Dim name As String
MMControl1.Command = "close"
CommonDialog1.FileName = ""
CommonDialog1.ShowOpen
CommonDialog1.Filter = "cd文件(*.cda)|*.cda"
name = CommonDialog1.FileName
If name = "" Then
MsgBox "未选定CD文件!", , "提示”"
Else
Label1.Caption = name
MMControl1.FileName = name
MMControl1.Command = "open"
MMControl1.Command = "play"
End If
End Sub
Private Sub Command2_Click()
Unload Form1
End Sub
Private Sub form_unload(cancel As Integer)
MMControl1.Command = "stop"
MMControl1.Command = "close"
End Sub
Private Sub Form_Load()
MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "CDAudio"
MMControl1.Command = "open"
MMControl1.Command = "play"
MMControl1.Command = "close"
MMControl1.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -