📄 frmvolumelabel.frm
字号:
VERSION 5.00
Begin VB.Form FrmVolumeLabel
BorderStyle = 1 'Fixed Single
Caption = "选择卷标名称"
ClientHeight = 2490
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
Icon = "FrmVolumeLabel.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2490
ScaleWidth = 4680
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command2
Caption = "确定(&O)"
Height = 375
Left = 3720
TabIndex = 8
Top = 1920
Width = 855
End
Begin VB.CommandButton Command1
Caption = "修改(&M)"
Height = 375
Left = 3720
TabIndex = 7
Top = 1440
Width = 855
End
Begin VB.TextBox TxtVolumeLabel
Height = 375
Left = 120
TabIndex = 6
Top = 1440
Width = 3495
End
Begin VB.Frame Frame1
Height = 60
Left = 0
TabIndex = 5
Top = 1320
Width = 4695
End
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 615
Left = 0
Picture = "FrmVolumeLabel.frx":0442
ScaleHeight = 615
ScaleWidth = 4935
TabIndex = 2
Top = 0
Width = 4935
Begin VB.Timer Timer1
Interval = 50
Left = 240
Top = 120
End
End
Begin VB.PictureBox Picture2
BorderStyle = 0 'None
Height = 135
Left = 0
Picture = "FrmVolumeLabel.frx":A7E4
ScaleHeight = 135
ScaleWidth = 7455
TabIndex = 0
Top = 600
Width = 7455
Begin VB.PictureBox Picture3
BorderStyle = 0 'None
Height = 135
Left = 1920
Picture = "FrmVolumeLabel.frx":C04A
ScaleHeight = 135
ScaleWidth = 5655
TabIndex = 1
Top = 0
Width = 5655
End
End
Begin VB.Label Label3
Caption = "格式:yyyymmddhhmmssXX(年月日时分秒序号)"
Height = 255
Left = 120
TabIndex = 10
Top = 2160
Width = 3615
End
Begin VB.Label LabelVolumeLabel
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 1560
TabIndex = 4
Top = 900
Width = 2775
End
Begin VB.Label Label2
Caption = "请确认您修改的卷标名称唯一"
Height = 255
Left = 120
TabIndex = 9
Top = 1920
Width = 3375
End
Begin VB.Label Label1
Caption = "当前卷标名称"
Height = 255
Left = 240
TabIndex = 3
Top = 960
Width = 1215
End
End
Attribute VB_Name = "FrmVolumeLabel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public gVolumeLabel As String
Private Sub Command1_Click()
If Len(TxtVolumeLabel) <> 16 Or IsNumeric(TxtVolumeLabel) = False Then
MsgBox "您输入的卷标名称格式不正确,请重新输入", vbExclamation, XTTS
TxtVolumeLabel.SetFocus
Exit Sub
End If
Set GblRdoRes = GblRdoCon.OpenResultset("select * from ROOT_table where root_name='" + TxtVolumeLabel + "'", rdOpenDynamic, rdConcurRowVer)
If Not GblRdoRes.EOF Then
MsgBox "您输入的卷标名称不唯一,请重新输入", vbExclamation, XTTS
TxtVolumeLabel.SetFocus
Exit Sub
End If
LabelVolumeLabel = TxtVolumeLabel
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
LabelVolumeLabel = Format(Date, "yyyymmdd") + Format(Time, "hhmmss") + "01"
Set GblRdoRes = GblRdoCon.OpenResultset("select * from ROOT_table where root_name='" + LabelVolumeLabel + "'", rdOpenDynamic, rdConcurRowVer)
While Not GblRdoRes.EOF '确保卷标唯一
LabelVolumeLabel = Format(Date, "yyyymmddhhmmss") + "01"
Set GblRdoRes = GblRdoCon.OpenResultset("select * from ROOT_table where root_name='" + LabelVolumeLabel + "'", rdOpenDynamic, rdConcurRowVer)
Wend
End Sub
Private Sub LabelVolumeLabel_Change()
gVolumeLabel = LabelVolumeLabel
End Sub
Private Sub Timer1_Timer()
Picture3.Left = Picture3.Left + 50
If Picture3.Left > Picture2.Left + Picture2.Width Then
Picture3.Left = Picture2.Left - Picture3.Width
End If
End Sub
Public Function GetVolumeLabel() As String
On Error GoTo Err
FrmVolumeLabel.Show 1
GetVolumeLabel = gVolumeLabel
Unload FrmVolumeLabel
Err:
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -