📄 frmaddcar.frm
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form frmAddCar
Caption = "添加车辆"
ClientHeight = 5175
ClientLeft = 60
ClientTop = 345
ClientWidth = 7275
LinkTopic = "Form8"
ScaleHeight = 5175
ScaleWidth = 7275
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command4
Caption = "删除"
Height = 495
Left = 600
TabIndex = 4
Top = 4560
Width = 1215
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "FRMADDCar.frx":0000
Height = 3615
Left = 240
OleObjectBlob = "FRMADDCar.frx":0014
TabIndex = 3
Top = 240
Width = 6855
End
Begin VB.CommandButton Command3
Caption = "增加"
Height = 495
Left = 2160
TabIndex = 2
Top = 4560
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 5400
TabIndex = 1
Top = 4560
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "保存"
Height = 495
Left = 3720
TabIndex = 0
Top = 4560
Width = 1215
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 5160
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 3960
Visible = 0 'False
Width = 1935
End
End
Attribute VB_Name = "frmAddCar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Data1.Recordset.Edit
Data1.Recordset.Update
Data1.RecordSource = "SELECT * FROM target ORDER BY ID"
Data1.Refresh
MDIMainForm.oTargetManager.Rebuild
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
On Error Resume Next
Data1.Recordset.AddNew
Data1.Recordset.Fields(0) = 0
Data1.Recordset.Fields(7) = ""
Data1.Recordset.Update
Data1.Refresh
End Sub
Private Sub Command4_Click()
Data1.Recordset.Edit
Data1.Recordset.Delete
Data1.Refresh
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\system\gps.mdb"
Data1.RecordSource = "SELECT * FROM target ORDER BY ID"
End Sub
Private Sub Form_Resize()
DBGrid1.left = 100
DBGrid1.top = 100
DBGrid1.Width = frmAddCar.Width - 1000
DBGrid1.Height = frmAddCar.Height - 1500
Command2.top = DBGrid1.Height + 500
Command2.left = frmAddCar.Width - 1500
Command1.top = DBGrid1.Height + 500
Command1.left = frmAddCar.Width - 3000
Command3.top = DBGrid1.Height + 500
Command3.left = frmAddCar.Width - 4500
Command4.top = DBGrid1.Height + 500
Command4.left = frmAddCar.Width - 6000
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -