我自己把程序编好了,发上来给各位参考,请多指教。
代码如下:
Dim fn As String
Private Sub Command1_Click()
'CancelError 为 True。
On Error GoTo ErrHandler
'设置过滤器。
CommonDialog1.Filter = "All Files (*.*)"
'指定缺省过滤器。
CommonDialog1.FilterIndex = 2
'显示“打开”对话框。
CommonDialog1.ShowOpen
'调用打开文件的过程。
fn = CommonDialog1.FileName
Label2.Caption = fn
Exit Sub
ErrHandler:
'用户按“取消”按钮。
Exit Sub
End Sub
Private Sub Command2_Click()
MMControl1.Command = "close"
End Sub
Private Sub Timer1_Timer()
tsy = Text2.Text
keep = Text1.Text
Static a As Integer, b As Integer
a = a + 1
If a = 60 Then
b = b + 1
a = 0
If b = keep Then
MMControl1.FileName = fn
MMControl1.Command = "open"
MMControl1.Command = "play"
MsgBox tsy, vbOKOnly, "提示"
b = 0
End If
End If
End Sub
窗体界面倒是可以根据自己喜好设定。