📄 通讯录.frm
字号:
Height = 495
Left = 360
TabIndex = 29
Top = 3240
Width = 375
End
Begin VB.Label Label9
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "×"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 255
Left = 5520
TabIndex = 28
Top = 0
Width = 255
End
Begin VB.Label Label8
Alignment = 2 'Center
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = "查询"
ForeColor = &H00C00000&
Height = 375
Left = 3840
TabIndex = 16
Top = 5880
Width = 735
End
Begin VB.Label Label6
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = " 关于"
ForeColor = &H00C00000&
Height = 375
Left = 4680
TabIndex = 17
Top = 5880
Width = 735
End
Begin VB.Label Label5
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = " 更新"
ForeColor = &H00C00000&
Height = 375
Left = 3000
TabIndex = 15
Top = 5880
Width = 735
End
Begin VB.Label Label4
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = " 删除"
ForeColor = &H00C00000&
Height = 375
Left = 1320
TabIndex = 14
Top = 5880
Width = 735
End
Begin VB.Label Label3
BackColor = &H00FFFF00&
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = " 添加"
ForeColor = &H00C00000&
Height = 375
Left = 480
TabIndex = 13
Top = 5880
Width = 735
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "E-Mail "
ForeColor = &H00FF0000&
Height = 375
Index = 2
Left = 120
TabIndex = 27
Top = 3840
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "生日"
ForeColor = &H00FF0000&
Height = 375
Index = 10
Left = 240
TabIndex = 26
Top = 1920
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "呼机"
ForeColor = &H00FF0000&
Height = 375
Index = 9
Left = 240
TabIndex = 25
Top = 2400
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "邮编"
ForeColor = &H00FF0000&
Height = 375
Index = 8
Left = 3600
TabIndex = 24
Top = 2880
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "备注"
ForeColor = &H00FF0000&
Height = 375
Index = 7
Left = 240
TabIndex = 23
Top = 4800
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "姓名"
ForeColor = &H00FF0000&
Height = 495
Index = 6
Left = 240
TabIndex = 22
Top = 1440
UseMnemonic = 0 'False
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "电话"
ForeColor = &H00FF0000&
Height = 375
Index = 5
Left = 3000
TabIndex = 21
Top = 1920
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "手机"
ForeColor = &H00FF0000&
Height = 375
Index = 4
Left = 3000
TabIndex = 20
Top = 2400
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "地址"
ForeColor = &H00FF0000&
Height = 375
Index = 3
Left = 240
TabIndex = 19
Top = 2880
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "关系"
ForeColor = &H00FF0000&
Height = 375
Index = 0
Left = 3120
TabIndex = 18
Top = 1440
Width = 375
End
Begin VB.Label Label1
BackColor = &H00FFFF00&
BackStyle = 0 'Transparent
Caption = " 个 人 通 讯 录"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 615
Left = 1080
TabIndex = 0
Top = 240
Width = 3255
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim msg As String
Dim answer As Long
Dim i As Integer
Private Sub Form_Load()
For i = 0 To 11
Text1(i).Enabled = False
Next
If App.PrevInstance Then
MsgBox ("程序已经运行,不能再次装载!"), vbExclamation
Unload Me
End If
Data1.DatabaseName = App.Path & "\address.mdb"
Label5.Enabled = False
End Sub
'拖动无标题栏窗口
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim r As Long
Dim i
If Button = 1 Then
i = ReleaseCapture()
r = SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub
Private Sub Label12_Click()
For i = 0 To 11
Text1(i).Enabled = True
Next
Label5.Enabled = True
Data1.Recordset.Edit
End Sub
Private Sub Label3_Click()
answer = MsgBox("你要添加新纪录吗?", vbYesNo, "个人通讯录")
If answer = vbYes Then
For i = 0 To 11
Text1(i).Text = ""
Text1(i).Enabled = True
Label5.Enabled = True
Text1(0).SetFocus
Data1.Recordset.AddNew
Next
End If
End Sub
Private Sub Label4_Click()
answer = MsgBox("你真的要删除此记录吗?", vbOKCancel, "个人通讯录")
If answer = vbCancel Then
Exit Sub
End If
If Data1.Recordset.RecordCount = 0 Then
MsgBox "对不起,你的通讯薄无记录!请添加!", vbOKOnly, "个人通讯录"
Exit Sub
End If
Data1.Recordset.Delete
Data1.Recordset.MoveFirst
End Sub
Private Sub Label5_Click()
Dim ret As Long
ret = MsgBox(" 确实要更新纪录吗?", vbYesNo, "个人通讯录")
If ret = vbYes Then
Data1.Recordset.Update
End If
Label5.Enabled = False
For i = 0 To 11
Text1(i).Enabled = False
Next
Data1.Recordset.MoveFirst
End Sub
Private Sub Label6_Click()
Form2.Show
End Sub
Private Sub Label7_Click()
End
End Sub
Private Sub Label8_Click()
Form3.Show
End Sub
Private Sub Label9_Click()
answer = MsgBox(" 退出本程序吗?", vbYesNo, "个人通讯录")
If answer = vbYes Then
End
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -