- VERSION 5.00
- Begin VB.Form frmTime
- Caption = "录制时长"
- ClientHeight = 2070
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 3885
- LinkTopic = "Form1"
- ScaleHeight = 2070
- ScaleWidth = 3885
- StartUpPosition = 3 '窗口缺省
- Begin VB.TextBox txtTime
- Alignment = 1 'Right Justify
- Height = 270
- Left = 1680
- TabIndex = 3
- Text = "0"
- Top = 360
- Width = 615
- End
- Begin VB.VScrollBar VScroll1
- Height = 270
- Left = 2280
- Max = 0
- Min = 100
- TabIndex = 2
- Top = 360
- Value = 1
- Width = 255
- End
- Begin VB.CommandButton cmdOK
- Caption = "确定"
- Height = 495
- Left = 600
- TabIndex = 1
- Top = 1125
- Width = 1215
- End
- Begin VB.CommandButton cmdExit
- Caption = "退出"
- Height = 495
- Left = 2040
- TabIndex = 0
- Top = 1125
- Width = 1215
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "秒"
- Height = 180
- Left = 2640
- TabIndex = 5
- Top = 405
- Width = 180
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "录制时长:"
- Height = 180
- Left = 720
- TabIndex = 4
- Top = 405
- Width = 900
- End
- End
- Attribute VB_Name = "frmTime"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdExit_Click() '“退出”按钮
- Unload Me '卸载窗体
- End Sub
- Private Sub cmdOK_Click() '“确定”按钮
- sngTime = Val(txtTime.Text) '获取时长数值
- If sngTime > 0 Then '若设置的值大于0
- frmCamera.ezVidCap1.TimeLimit = sngTime '设置录制时间的长度
- frmCamera.ezVidCap1.TimeLimitEnabled = True '允许时间限制
- Else '若设置的值小于等于0
- frmCamera.ezVidCap1.TimeLimitEnabled = False '禁止时间限制
- End If
- Unload Me '卸载窗体
- End Sub
- Private Sub Form_Load()
- sngTime = frmCamera.ezVidCap1.TimeLimit '获取原来设置的录制时长
- VScroll1.Value = sngTime '设置滚动条的值
- txtTime.Text = sngTime '显示原来设置的录制时长
- End Sub
- Private Sub txtTime_KeyPress(KeyAscii As Integer)
- If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = Asc(".") Then '若输入提0~9或小数点
- Else
- KeyAscii = 0 '否则取消输入
- End If
- End Sub
- Private Sub txtTime_Validate(Cancel As Boolean)
- Dim s As Single
- s = Val(txtTime.Text) '获取输入的内容
- If s >= 0 Then '若输入的值大于0
- VScroll1.Value = s '设置滚动条的值
- End If
- End Sub
- Private Sub VScroll1_Change()
- txtTime.Text = VScroll1.Value '将滚动条的值显示到文本框中
- End Sub