form3.frm
来自「一套收费计算机系统」· FRM 代码 · 共 265 行
FRM
265 行
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{E2690E23-9719-101B-9306-0020AF234C9D}#4.1#0"; "CSCMD32.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Form3address
BorderStyle = 1 'Fixed Single
Caption = "预设地址"
ClientHeight = 4620
ClientLeft = 45
ClientTop = 330
ClientWidth = 4425
ControlBox = 0 'False
LinkTopic = "Form3"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4620
ScaleWidth = 4425
Begin VB.CommandButton Command3
Cancel = -1 'True
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 1800
TabIndex = 7
Top = 2280
Width = 855
End
Begin CSCmdLibCtl.CSCmdBtn Command2
Default = -1 'True
Height = 855
Left = 1800
OleObjectBlob = "Form3.frx":0000
TabIndex = 4
Top = 3720
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 2760
TabIndex = 3
Top = 3960
Width = 1575
End
Begin CSCmdLibCtl.CSCmdBtn Command1
Height = 855
Left = 1800
OleObjectBlob = "Form3.frx":04FD
TabIndex = 2
Top = 480
Width = 855
End
Begin VB.ListBox List1
Height = 3120
Left = 2760
TabIndex = 1
Top = 480
Width = 1575
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1920
Top = 4320
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 2
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "FILE NAME=C:\My Documents\花寨子2000.udl"
OLEDBString = ""
OLEDBFile = "C:\My Documents\花寨子2000.udl"
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "地址库"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataList DataList1
Bindings = "Form3.frx":09FB
Height = 4050
Left = 120
TabIndex = 0
Top = 480
Width = 1575
_ExtentX = 2778
_ExtentY = 7144
_Version = 393216
ListField = "地址"
End
Begin VB.Label Label2
Caption = "删除地址:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
TabIndex = 6
Top = 120
Width = 1575
End
Begin VB.Label Label1
Caption = "已有地址:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 5
Top = 120
Width = 1575
End
End
Attribute VB_Name = "Form3address"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim entrydate As Date
Private Sub command1_Click() '删除
If Command1.Caption = "删 除" Then
Dim dstring As String
Adodc1.Recordset.Move DataList1.SelectedItem - 1, 1
dstring = Adodc1.Recordset.Fields(1).Value
Adodc1.Recordset.Delete
Adodc1.Recordset.Requery
DataList1.ReFill
List1.AddItem dstring
Command1.Enabled = False
Else
Adodc1.Recordset.AddNew 1, List1.List(List1.ListIndex)
Adodc1.Recordset.Update
Adodc1.Recordset.Requery
List1.RemoveItem List1.ListIndex
DataList1.ReFill
Command1.Enabled = False
End If
End Sub
Private Sub Command2_Click() '添加
Adodc1.Recordset.AddNew 1, Text1.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Requery
Text1.Text = ""
Text1.SetFocus
DataList1.ReFill
Command2.Enabled = False
Command1.Enabled = False
End Sub
Private Sub Command3_Click() '取消
Adodc1.Recordset.Close
Set Adodc1.Recordset = Nothing
Unload Me
End Sub
Private Sub DataList1_Click()
Command1.Enabled = True
Command1.Picture = LoadPicture("c:\my documents\Arw06rt.ico")
Command1.Caption = "删 除"
End Sub
Private Sub DataList1_DblClick()
Dim dstring As String
Adodc1.Recordset.Move DataList1.SelectedItem - 1, 1
dstring = Adodc1.Recordset.Fields(1).Value
Adodc1.Recordset.Delete
Adodc1.Recordset.Requery
DataList1.ReFill
List1.AddItem dstring
Command1.Enabled = False
End Sub
Private Sub DataList1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
'Debug.Print x & "00000000" & y
End Sub
Private Sub Form_Load()
Command1.Enabled = False '删除
Command2.Enabled = False '添加
entrydate = Now()
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Call history(staff, entrydate, Me.Caption, Now())
End Sub
Private Sub List1_Click()
Command1.Enabled = True
Command1.Picture = LoadPicture("c:\my documents\Arw06lt.ico")
Command1.Caption = "恢 复"
End Sub
Private Sub List1_DblClick()
Adodc1.Recordset.AddNew 1, List1.List(List1.ListIndex)
Adodc1.Recordset.Update
Adodc1.Recordset.Requery
List1.RemoveItem List1.ListIndex
DataList1.ReFill
Command1.Enabled = False
End Sub
Private Sub Text1_Change()
Command2.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?