📄 addrec_f.frm
字号:
VERSION 5.00
Begin VB.Form Form2
BackColor = &H00404080&
Caption = "Form2"
ClientHeight = 6735
ClientLeft = 60
ClientTop = 345
ClientWidth = 5325
HelpContextID = 20
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 6735
ScaleWidth = 5325
Begin VB.CommandButton Command2
Caption = "Cancel"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3000
TabIndex = 16
Top = 5520
WhatsThisHelpID = 20
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "Ok"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 960
TabIndex = 15
Top = 5520
WhatsThisHelpID = 20
Width = 1335
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 315
Left = 1320
TabIndex = 6
Top = 1320
WhatsThisHelpID = 20
Width = 3255
End
Begin VB.TextBox Text2
BackColor = &H00FFFFFF&
Height = 315
Left = 1320
TabIndex = 5
Top = 1920
WhatsThisHelpID = 20
Width = 3255
End
Begin VB.TextBox Text3
BackColor = &H00FFFFFF&
Height = 315
Left = 1320
TabIndex = 4
Top = 2520
WhatsThisHelpID = 20
Width = 3255
End
Begin VB.TextBox Text4
BackColor = &H00FFFFFF&
Height = 315
Left = 1320
TabIndex = 3
Top = 3000
WhatsThisHelpID = 20
Width = 3255
End
Begin VB.TextBox Text5
BackColor = &H00FFFFFF&
Height = 315
Left = 1320
TabIndex = 2
Top = 3600
WhatsThisHelpID = 20
Width = 3255
End
Begin VB.TextBox Text6
BackColor = &H00FFFFFF&
Height = 315
Left = 1320
TabIndex = 1
Top = 4200
WhatsThisHelpID = 20
Width = 3255
End
Begin VB.TextBox Text7
BackColor = &H00FFFFFF&
Height = 315
Left = 1320
TabIndex = 0
Top = 4800
WhatsThisHelpID = 20
Width = 3255
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "S/No :"
Height = 255
Left = 360
TabIndex = 14
Top = 1440
WhatsThisHelpID = 20
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "&Name :"
Height = 255
Left = 360
TabIndex = 13
Top = 1920
WhatsThisHelpID = 20
Width = 855
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "&Address :"
Height = 255
Left = 360
TabIndex = 12
Top = 2520
WhatsThisHelpID = 20
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "&City :"
Height = 255
Left = 360
TabIndex = 11
Top = 3000
WhatsThisHelpID = 20
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "&State :"
Height = 255
Left = 360
TabIndex = 10
Top = 3600
WhatsThisHelpID = 20
Width = 855
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "&Phone 1 :"
Height = 255
Left = 360
TabIndex = 9
Top = 4200
WhatsThisHelpID = 20
Width = 855
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "&Phone 2 :"
Height = 255
Left = 360
TabIndex = 8
Top = 4800
WhatsThisHelpID = 20
Width = 855
End
Begin VB.Label Label8
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Record(s) Adding"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = -1 'True
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 615
Left = 1080
TabIndex = 7
Top = 360
WhatsThisHelpID = 20
Width = 3015
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''Description: This is small program to handle address records of friends or contacts
''I call this project as My Address Diary
''Author : Sanjay Sharma Contact No:9419118285(M)
''Sainik Colony , Jammu , India
''E-Mail : Sanjay79t@yahoo.co.in , Sanjay79t@hotmail.com
''Bugs , Suggestions & Comments are well come
''This was my App. I own my PC.
''Please vote
Dim tot_rec As Long
Dim fnum As Integer
Dim rec_val As rec_data
Private Sub Command1_Click()
If IsNull(Text1.Text) Then
Text1.SetFocus
MsgBox "Must be provided with a S/no."
End If
rec_val.name = Text2.Text
rec_val.addr = Text3.Text
rec_val.city = Text4.Text
rec_val.stat = Text5.Text
rec_val.ph1 = Text6.Text
rec_val.ph2 = Text7.Text
Put #fnum, rec_val.s_no, rec_val
MsgBox "Record is inserted successfuly. Go forward"
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Form2.Top = -400
Form2.Left = 0
Form2.Width = 5445
Form2.Height = 6780
fnum = FreeFile
Open App.Path & "\address.san" For Random As #fnum Len = Len(rec_val)
tot_rec = LOF(fnum) / Len(rec_val)
If tot_rec = 0 Then
rec_val.s_no = 1
Text1.Text = 1
Else
rec_val.s_no = tot_rec + 1
Text1.Text = tot_rec + 1
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Close #fnum
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_Change()
If IsNumeric(Right(Trim(Text2.Text), 1)) Then ' Or (Asc(Right(Trim(Text2.Text), 1)) >= 33 Or Asc(Right(Trim(Text2.Text), 1) <= 48)) Then
MsgBox "Please input text only "
Text2.Text = ""
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.Text = UCase(Text2.Text)
Text3.SetFocus
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = UCase(Text3.Text)
Text4.SetFocus
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text4.Text = UCase(Text4.Text)
Text5.SetFocus
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text5.Text = UCase(Text5.Text)
Text6.SetFocus
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text7.SetFocus
End If
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -