📄 例[15-2].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 = "例[15-2] 简单VCD播放器"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 3735
LinkTopic = "Form1"
ScaleHeight = 213
ScaleMode = 3 'Pixel
ScaleWidth = 249
StartUpPosition = 3 '窗口缺省
Begin MCI.MMControl MC1
Height = 330
Left = 120
TabIndex = 4
Top = 2400
Width = 3615
_ExtentX = 6376
_ExtentY = 582
_Version = 393216
DeviceType = ""
FileName = ""
End
Begin VB.PictureBox P1
Height = 2175
Left = 120
ScaleHeight = 2115
ScaleWidth = 3435
TabIndex = 3
Top = 120
Width = 3495
Begin MSComDlg.CommonDialog CD1
Left = 2640
Top = 840
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
End
Begin VB.CommandButton Command3
Caption = "关闭"
Height = 375
Left = 2640
TabIndex = 2
Top = 2760
Width = 975
End
Begin VB.CommandButton Command2
Caption = "播放"
Height = 375
Left = 1560
TabIndex = 1
Top = 2760
Width = 975
End
Begin VB.CommandButton Command1
Caption = "选择文件…"
Height = 375
Left = 120
TabIndex = 0
Top = 2760
Width = 1215
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()
On Error Resume Next '程序略过出错的语句继续执行
CD1.Filter = "dat文件|*.dat" '文件类型为dat
CD1.ShowOpen '调用打开对话框
MC1.FileName = CD1.FileName '对话框中选择的文件为播放文件
MC1.DeviceType = "mpegvideo" '设备类型为MPEGvideo
MC1.Command = "open" '打开多媒体设备
MC1.hWndDisplay = P1.hWnd '电影播放窗口为图片框窗口
End Sub
Private Sub Command2_Click()
MC1.Command = "play" '开始播放
End Sub
Private Sub Command3_Click()
MC1.Command = "close" '关闭多媒体设备
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -