📄 frmviewreportvideo.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmViewReportVideo
BorderStyle = 3 'Fixed Dialog
Caption = "报告视频"
ClientHeight = 3540
ClientLeft = 45
ClientTop = 330
ClientWidth = 7860
Icon = "frmViewReportVideo.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3540
ScaleWidth = 7860
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.PictureBox Picture1
Align = 2 'Align Bottom
BorderStyle = 0 'None
Height = 495
Left = 0
ScaleHeight = 495
ScaleWidth = 7860
TabIndex = 1
Top = 3045
Width = 7860
Begin VB.CommandButton cmdDel
Caption = "删除视频[Del]"
Height = 390
Left = 120
TabIndex = 5
Tag = "确定"
Top = 0
Width = 1350
End
Begin VB.CommandButton cmdSound
Caption = "播放配音 [F6]"
Height = 390
Left = 4950
TabIndex = 4
Tag = "应用(&A)"
Top = 0
Width = 1350
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "退出 [ESC]"
Height = 390
Left = 6420
TabIndex = 3
Tag = "取消"
Top = 0
Width = 1350
End
Begin VB.CommandButton cmdVideo
Caption = "播放视频 [F5]"
Height = 390
Left = 3465
TabIndex = 2
Tag = "确定"
Top = 0
Width = 1350
End
End
Begin MSComctlLib.ListView lvwVideo
Height = 2775
Left = 105
TabIndex = 0
Top = 135
Width = 7665
_ExtentX = 13520
_ExtentY = 4895
View = 3
LabelEdit = 1
LabelWrap = 0 'False
HideSelection = 0 'False
FullRowSelect = -1 'True
_Version = 393217
SmallIcons = "imlVideo"
ColHdrIcons = "imlVideo"
ForeColor = -2147483640
BackColor = -2147483643
Appearance = 1
NumItems = 4
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "视频文件名"
Object.Width = 8467
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 1
Text = "大小"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 2
Text = "帧数"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "配音"
Object.Width = 1323
EndProperty
End
Begin MSComctlLib.ImageList imlVideo
Left = 0
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmViewReportVideo.frx":0E42
Key = "Video"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmViewReportVideo.frx":0F9E
Key = "Sound"
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmViewReportVideo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
'---------------------
'卸载窗体
'---------------------
Unload Me
End Sub
Private Sub cmdDel_Click()
Dim VideoFileName As String
VideoFileName = lvwVideo.SelectedItem.Tag
lvwVideo.ListItems.Remove lvwVideo.SelectedItem.Index
If FSO.FileExists(VideoFileName) Then
OpenRSClient "DELETE FROM US_MEDIA WHERE FILE_NAME = '" & VideoFileName & "'", "Data"
FSO.DeleteFile VideoFileName
End If
If USV.AllowAudio Then
VideoFileName = GetFilePath(VideoFileName) & GetFirstString(GetFileName(VideoFileName), ".") & ".WAV"
If FSO.FileExists(VideoFileName) Then
FSO.DeleteFile VideoFileName
End If
End If
End Sub
Private Sub cmdSound_Click()
'-------------------------------
'播放选择项目的声音
'-------------------------------
Dim strFile As String
With lvwVideo
If .SelectedItem Is Nothing Then
Exit Sub
End If
strFile = .SelectedItem.ListSubItems(3).Tag
'如果该文件存在,则先删除
If FSO.FileExists(strFile) Then
PlaySound strFile
End If
End With
End Sub
Private Sub cmdVideo_Click()
'检查是否有选中的条目
If lvwVideo.SelectedItem Is Nothing Then
Exit Sub
End If
'播放视频
Screen.MousePointer = vbHourglass
frmVideoView.FileName = lvwVideo.SelectedItem.Tag
If USV.AllowAudio Then frmVideoView.SoundFileName = lvwVideo.SelectedItem.ListSubItems(3).Tag
frmVideoView.Show vbModal
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'---------------------------------
'键盘事件
'---------------------------------
Select Case KeyCode
Case vbKeyF5
cmdVideo_Click
Case vbKeyF6
cmdSound_Click
Case vbKeyEscape
cmdCancel_Click
Case Else
End Select
End Sub
Private Sub Form_Load()
If UserType <> "系统管理员" And UserType <> "超级管理员" Then cmdDel.Enabled = False
SetLvwPlainHead lvwVideo, Me.hwnd
If USV.AllowAudio = False Then
lvwVideo.ColumnHeaders.Remove (3)
lvwVideo.ColumnHeaders.Remove (3)
cmdSound.Visible = False
End If
End Sub
Private Sub lvwVideo_Click()
If USV.AllowAudio Then
If lvwVideo.SelectedItem.ListSubItems(3).Tag = "" Then
cmdSound.Enabled = False
Else
cmdSound.Enabled = True
End If
End If
End Sub
Private Sub lvwVideo_DblClick()
'--------------------------
'相当于双击事件
'--------------------------
cmdVideo_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -