⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 vb精彩编程希望大家有用
💻 FRM
字号:
VERSION 5.00
Object = "{C1A8AF28-1257-101B-8FB0-0020AF039CA3}#1.1#0"; "MCI32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Begin VB.Form Form1 
   Caption         =   "多媒体播放器"
   ClientHeight    =   1980
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   7125
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   1980
   ScaleWidth      =   7125
   StartUpPosition =   3  '窗口缺省
   WhatsThisHelp   =   -1  'True
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   8400
      TabIndex        =   7
      Top             =   1320
      Width           =   615
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   6720
      Top             =   120
   End
   Begin ComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   6
      Top             =   1605
      Width           =   7125
      _ExtentX        =   12568
      _ExtentY        =   661
      SimpleText      =   "fg"
      _Version        =   327682
      BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
         NumPanels       =   5
         BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Text            =   "剩余时间"
            TextSave        =   "剩余时间"
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Text            =   ""
            TextSave        =   ""
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Text            =   "总时间"
            TextSave        =   "总时间"
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel4 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Text            =   ""
            TextSave        =   ""
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel5 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Text            =   "创世纪工作室"
            TextSave        =   "创世纪工作室"
            Key             =   ""
            Object.Tag             =   ""
            Object.ToolTipText     =   ""
         EndProperty
      EndProperty
   End
   Begin MSComDlg.CommonDialog common 
      Left            =   6120
      Top             =   0
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CheckBox Check1 
      Caption         =   "循环"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   120
      Width           =   735
   End
   Begin MCI.MMControl MMControl1 
      Height          =   420
      Left            =   1440
      TabIndex        =   1
      Top             =   120
      Width           =   4455
      _ExtentX        =   7858
      _ExtentY        =   741
      _Version        =   393216
      Frames          =   30
      BorderStyle     =   0
      EjectEnabled    =   -1  'True
      DeviceType      =   ""
      FileName        =   ""
   End
   Begin ComctlLib.Slider Slider1 
      Height          =   375
      Left            =   1080
      TabIndex        =   0
      Top             =   720
      Width           =   5415
      _ExtentX        =   9551
      _ExtentY        =   661
      _Version        =   327682
      LargeChange     =   10
      SmallChange     =   3
      Max             =   1
   End
   Begin VB.Label Label4 
      Caption         =   "运行条"
      Height          =   375
      Left            =   240
      TabIndex        =   8
      Top             =   720
      Width           =   615
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "结束"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   6000
      TabIndex        =   5
      Top             =   1320
      Width           =   570
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "进行"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3360
      TabIndex        =   4
      Top             =   1320
      Width           =   570
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "起始"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1080
      TabIndex        =   3
      Top             =   1320
      Width           =   570
   End
   Begin VB.Menu file 
      Caption         =   "文件"
      Begin VB.Menu dakai 
         Caption         =   "打开"
      End
      Begin VB.Menu huanbi 
         Caption         =   "关闭"
      End
      Begin VB.Menu tuichu 
         Caption         =   "退出"
      End
   End
   Begin VB.Menu bofang 
      Caption         =   "播放"
      Begin VB.Menu zanting 
         Caption         =   "播放/暂停"
      End
      Begin VB.Menu ting 
         Caption         =   "停止"
      End
      Begin VB.Menu a 
         Caption         =   "-"
      End
      Begin VB.Menu xianhou 
         Caption         =   "向后跳跃"
      End
      Begin VB.Menu xiangqian 
         Caption         =   "向前跳跃"
      End
      Begin VB.Menu kuaijin 
         Caption         =   "快进"
      End
      Begin VB.Menu kuaitui 
         Caption         =   "快退"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim n As Integer, min As Integer, sec As Integer, shu2 As Integer, shu1 As Integer

Private Sub dakai_Click()
    Dim shu1 As Integer
    common.CancelError = True
    On Error GoTo han
    common.Flags = cdlOFNHideReadOnly
    common.Filter = "视屏文件(*.avi)|*.avi|MP3文件(*.mp3)|*.mp3|全部文件(*.*)|*.*|"
    common.FilterIndex = 2
    common.ShowOpen
    MMControl1.FileName = common.FileName
    MMControl1.Command = "open"
    MMControl1.TimeFormat = 0
    shu1 = MMControl1.Length / 1000
    Slider1.Max = shu1
    min = Int(shu1 / 60)
    sec = Int(shu1) Mod 60
    StatusBar1.Panels(4) = min & "分" & sec & "秒"
    Text1.Text = shu1
    MMControl1.Command = "play"
    Timer1.Enabled = True
    Exit Sub
han:
    Exit Sub
End Sub

Private Sub huanbi_Click()
    MMControl1.Command = "close"
    Slider1.SelStart = 1
    Timer1.Enabled = False
End Sub

Private Sub kuaijin_Click()
    MMControl1.Command = "step"
    MMControl1.Command = "play"
End Sub

Private Sub kuaitui_Click()
    MMControl1.Command = "back"
    MMControl1.Command = "play"
End Sub

Private Sub MMControl1_BackClick(Cancel As Integer)
    MMControl1.Command = "back"
    MMControl1.Command = "play"
End Sub

Private Sub MMControl1_PauseClick(Cancel As Integer)
    Timer1.Enabled = False
End Sub

Private Sub MMControl1_PlayClick(Cancel As Integer)
    Timer1.Enabled = True
End Sub

Private Sub MMControl1_StepClick(Cancel As Integer)
    MMControl1.Command = "step"
    MMControl1.Command = "play"
End Sub

Private Sub MMControl1_StopClick(Cancel As Integer)
    MMControl1.Command = "close"
    Timer1.Enabled = False
    Slider1.SelStart = 1
    n = 0
End Sub

Private Sub Timer1_Timer()
    n = n + 1
    If n = Text1.Text + 1 Then n = 0
    Slider1.SelStart = n
    shu2 = Text1.Text - n
    min = Int(shu2 / 60)
    sec = Int(shu2) Mod 60
    StatusBar1.Panels(2) = min & "分" & sec & "秒"
    If n = 0 Then Timer1.Enabled = False
    If Check1.Value = 1 Then
        If n = 0 Then
            MMControl1.From = 1
            MMControl1.Command = "play"
            Timer1.Enabled = True
        End If
    End If
End Sub

Private Sub ting_Click()
     MMControl1.Command = "prev"
End Sub

Private Sub tuichu_Click()
    End
End Sub

Private Sub xiangqian_Click()
    MMControl1.Command = "seek"
End Sub

Private Sub xianhou_Click()
    MMControl1.Command = "next"
End Sub

Private Sub zanting_Click()
    If MMControl1.Command = "play" Then
        MMControl1.Command = "pause"
    Else
        MMControl1.Command = "play"
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -