frmFile.frm
上传用户:szlwled
上传日期:2022-06-30
资源大小:95k
文件大小:3k
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.Form frmFile
- Caption = "设置文件"
- ClientHeight = 2025
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 6000
- LinkTopic = "Form1"
- ScaleHeight = 2025
- ScaleWidth = 6000
- StartUpPosition = 3 '窗口缺省
- Begin VB.CommandButton cmdBrowse
- Caption = "浏览"
- Height = 495
- Left = 4440
- TabIndex = 4
- Top = 323
- Width = 1095
- End
- Begin VB.CommandButton cmdOK
- Caption = "确定"
- Default = -1 'True
- Height = 495
- Left = 1800
- TabIndex = 3
- Top = 1200
- Width = 1095
- End
- Begin VB.CommandButton cmdExit
- Cancel = -1 'True
- Caption = "退出"
- Height = 495
- Left = 3360
- TabIndex = 2
- Top = 1200
- Width = 1095
- End
- Begin VB.TextBox txtFile
- Height = 375
- Left = 1440
- TabIndex = 0
- Top = 383
- Width = 3015
- End
- Begin MSComDlg.CommonDialog dlg1
- Left = 600
- Top = 1080
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- Flags = 1
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "视频文件名:"
- Height = 180
- Left = 360
- TabIndex = 1
- Top = 480
- Width = 1080
- End
- End
- Attribute VB_Name = "frmFile"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public strFilter As String '过滤器列表
- Public strSaveType As String '保存类型:BMP为图片文件,AVI为视频文件
- Private Sub cmdBrowse_Click() '“浏览”按钮
- dlg1.Filter = strFilter '设置通用对话框的过滤字符串
- If strSaveType = "AVI" Then '若是视频文件
- dlg1.DialogTitle = "设置AVI文件名" '设置通用对话框的标题
- Else '若是图片文件
- dlg1.DialogTitle = "设置BMP文件名" '设置通用对话框的标题
- End If
- dlg1.ShowSave '显示“保存”对话框
- txtFile.Text = dlg1.FileName '将通用对话框中的文件名填入文本框
- End Sub
- Private Sub cmdExit_Click() '“退出”按钮
- Unload Me '卸载窗体
- End Sub
- Private Sub cmdOK_Click() '“确定”按钮
- If strSaveType = "AVI" Then '视频文件
- strFileAVI = Trim(txtFile.Text) '设置全局变量保存视频文件名
- ElseIf strSaveType = "BMP" Then '图片文件
- strFileBMP = Trim(txtFile.Text) '设置全局变量保存图片文件名
- End If
- Unload Me '卸载窗体
- End Sub
- Private Sub Form_Load()
- dlg1.InitDir = App.Path '设置通用对话框的初始路径
- End Sub