📄 form5.frm
字号:
VERSION 5.00
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX"
Begin VB.Form Form5
Caption = "登记外出车辆"
ClientHeight = 3780
ClientLeft = 60
ClientTop = 345
ClientWidth = 6060
LinkTopic = "Form5"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3780
ScaleWidth = 6060
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command6
BackColor = &H8000000A&
Caption = "取消"
Height = 375
Left = 3840
Style = 1 'Graphical
TabIndex = 7
Top = 3240
Width = 1335
End
Begin VB.CommandButton Command5
BackColor = &H8000000A&
Caption = "确认"
Height = 375
Left = 840
Style = 1 'Graphical
TabIndex = 6
Top = 3240
Width = 1335
End
Begin VB.CommandButton Command4
Caption = ">"
Height = 375
Left = 2760
MouseIcon = "Form5.frx":0000
Style = 1 'Graphical
TabIndex = 5
ToolTipText = "删除一车辆"
Top = 2520
Width = 495
End
Begin VB.CommandButton Command3
Caption = ">>"
Height = 375
Left = 2760
MouseIcon = "Form5.frx":0442
MousePointer = 99 'Custom
TabIndex = 4
ToolTipText = "删除所有车辆"
Top = 2040
Width = 495
End
Begin VB.CommandButton Command2
Caption = "<<"
Height = 375
Left = 2760
MouseIcon = "Form5.frx":0884
MousePointer = 99 'Custom
TabIndex = 3
ToolTipText = "添加所有车辆"
Top = 1200
Width = 495
End
Begin VB.CommandButton Command1
Caption = "<"
Height = 375
Left = 2760
MouseIcon = "Form5.frx":0CC6
MousePointer = 99 'Custom
TabIndex = 2
ToolTipText = "添加一车辆"
Top = 720
Width = 495
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 405
Left = 4200
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 2640
Visible = 0 'False
Width = 1260
End
Begin VB.ListBox List1
BackColor = &H00C0FFC0&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 2460
Left = 240
TabIndex = 1
Top = 600
Width = 1935
End
Begin MSDBCtls.DBList DBList1
Bindings = "Form5.frx":1108
DataField = "Name"
DataSource = "Data1"
Height = 2490
Left = 3840
TabIndex = 0
Top = 600
Width = 1935
_ExtentX = 3413
_ExtentY = 4392
_Version = 393216
BackColor = 12648447
ForeColor = 16711680
ListField = "Name"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Image Image2
Height = 480
Left = 3840
Picture = "Form5.frx":1118
Top = 120
Width = 480
End
Begin VB.Image Image1
Height = 480
Left = 240
Picture = "Form5.frx":19E2
Top = 120
Width = 480
End
Begin VB.Label Label2
Caption = "所有车辆"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4440
TabIndex = 9
Top = 240
Width = 1095
End
Begin VB.Label Label1
Caption = "外出车辆"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 840
TabIndex = 8
Top = 240
Width = 1095
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim i As Integer
Dim Temp_flag As Boolean
If DBList1.Text <> "" Then
For i = 0 To List1.ListCount
If List1.List(i) = DBList1.Text Then
Temp_flag = True
End If
Next
If Temp_flag <> True Then
List1.AddItem DBList1.Text
Else
MsgBox "此辆车列表中存在", vbInformation, "提示"
End If
End If
Temp_flag = False
End Sub
Private Sub Command2_Click()
Dim rst As Recordset
Dim dbs As Database
Set dbs = DBEngine.Workspaces(0).OpenDatabase(strPath + PATH_DBDATA)
Set rst = dbs.OpenRecordset("target")
For i = 0 To List1.ListCount - 1
List1.RemoveItem 0
Next
Do While Not rst.EOF
List1.AddItem rst!Name
rst.MoveNext
Loop
End Sub
Private Sub Command3_Click()
Dim i As Integer
For i = 0 To List1.ListCount - 1
List1.RemoveItem 0
Next
End Sub
Private Sub Command4_Click()
Dim i As Integer
If List1.Text <> "" Then
List1.RemoveItem List1.ListIndex
Else
MsgBox "请选中要移去的车辆号", vbInformation, "提示"
End If
End Sub
Private Sub Command5_Click()
Dim i As Integer
ReDim Temp_Move_Car(List1.ListCount - 1) As String
Temp_Car_Num = List1.ListCount
For i = 0 To List1.ListCount - 1
Temp_Move_Car(i) = List1.List(i)
Next
Unload Me
Form2.Label1 = "登记外出车辆完毕"
Form2.Show
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub DBList1_DblClick()
Dim dbs As Database
Dim rst As Recordset
Dim Temp_id As Long
Set dbs = DBEngine.Workspaces(0).OpenDatabase(strPath + PATH_DBDATA)
Set rst = dbs.OpenRecordset("target")
rst.Index = "Name"
If CStr(DBList1.Text) <> "" Then
rst.Seek "=", DBList1.Text
If Not rst.NoMatch Then
Temp_id = rst!ID
End If
End If
If Not frmTarget.FindByID(Temp_id) Then Exit Sub
Temp_id = 0
frmTarget.Show
End Sub
Private Sub Form_Load()
Data1.DatabaseName = strPath + PATH_DBDATA
Data1.RecordSource = "Target"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -