⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmisd.frm

📁 Online Telephone Directory in Visual Basic
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form10 
   BorderStyle     =   0  'None
   Caption         =   "Form10"
   ClientHeight    =   7965
   ClientLeft      =   2700
   ClientTop       =   3015
   ClientWidth     =   14160
   LinkTopic       =   "Form10"
   ScaleHeight     =   7965
   ScaleWidth      =   14160
   ShowInTaskbar   =   0   'False
   WindowState     =   2  'Maximized
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   9480
      TabIndex        =   12
      Top             =   4320
      Width           =   3015
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   9480
      TabIndex        =   11
      Top             =   5040
      Width           =   3015
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   255
      Left            =   7080
      TabIndex        =   10
      Top             =   5880
      Value           =   1
      Width           =   5415
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H000000FF&
      Height          =   1575
      Left            =   7080
      TabIndex        =   3
      Top             =   2520
      Width           =   6135
      Begin VB.CommandButton Command7 
         Caption         =   "&Move"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   9
         Top             =   840
         Width           =   1815
      End
      Begin VB.CommandButton Command5 
         Caption         =   "&Sort"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   8
         Top             =   840
         Width           =   1815
      End
      Begin VB.CommandButton Command4 
         Caption         =   "&Close"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3840
         TabIndex        =   7
         Top             =   840
         Width           =   1815
      End
      Begin VB.CommandButton Command3 
         Caption         =   "&Delete"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3840
         TabIndex        =   6
         Top             =   480
         Width           =   1815
      End
      Begin VB.CommandButton Command2 
         Caption         =   "&Edit"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   5
         Top             =   480
         Width           =   1815
      End
      Begin VB.CommandButton Command1 
         Caption         =   "&Add"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   4
         Top             =   480
         Width           =   1815
      End
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H000000FF&
      Height          =   1575
      Left            =   7080
      TabIndex        =   0
      Top             =   2520
      Visible         =   0   'False
      Width           =   6135
      Begin VB.CommandButton Command6 
         Caption         =   "&Update"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   960
         TabIndex        =   2
         Top             =   600
         Width           =   1815
      End
      Begin VB.CommandButton Command8 
         Caption         =   "&Cancel"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3240
         TabIndex        =   1
         Top             =   600
         Width           =   1815
      End
   End
   Begin VB.Label Label1 
      BackColor       =   &H00808080&
      Caption         =   "State Name"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   7200
      TabIndex        =   17
      Top             =   4320
      Width           =   2175
   End
   Begin VB.Label Label2 
      BackColor       =   &H00808080&
      Caption         =   "I S D Code"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   7200
      TabIndex        =   16
      Top             =   5040
      Width           =   2175
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Label3"
      Height          =   195
      Left            =   12720
      TabIndex        =   15
      Top             =   5880
      Width           =   480
   End
   Begin VB.Image Image1 
      Height          =   3690
      Left            =   120
      Picture         =   "FrmISD.frx":0000
      Top             =   2880
      Width           =   6495
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "I S D"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   675
      Left            =   4560
      TabIndex        =   14
      Top             =   600
      Width           =   1305
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Details"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   675
      Left            =   6480
      TabIndex        =   13
      Top             =   600
      Width           =   1950
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H00000000&
      BackStyle       =   1  'Opaque
      Height          =   1935
      Left            =   6120
      Top             =   0
      Width           =   3975
   End
   Begin VB.Shape Shape2 
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00FFFFFF&
      Height          =   1935
      Left            =   4320
      Shape           =   2  'Oval
      Top             =   0
      Width           =   1815
   End
   Begin VB.Shape Shape1 
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00FFFFFF&
      Height          =   4935
      Left            =   0
      Top             =   2280
      Width           =   15015
   End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database, rs As Recordset, bt As Integer


Private Sub Command1_Click()
bt = 1
Frame1.Visible = False
Frame2.Visible = True
Text1.Text = ""
Text2.Text = ""
Label3.Caption = "Add Record"
HScroll1.Visible = False
End Sub

Private Sub Command2_Click()
bt = 2
Frame1.Visible = False
Frame2.Visible = True
Label3.Caption = "Edit Record"
HScroll1.Visible = False

End Sub

Private Sub Command3_Click()
X = MsgBox("Are you confirm to delete?", vbYesNo + vbQuestion)
If X = vbYes Then
rs.Delete
MsgBox "Removed Successfully", vbCritical
Form_Load
End If
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Command5_Click()
sr = InputBox("Enter the Column name to sort (State or Code) : ")
If sr <> "State" And sr <> "Code" Then
MsgBox "Invalid Column", vbCritical
Exit Sub
End If
Set rs = db.OpenRecordset("Select * from ISD order by " & sr)
rs.MoveFirst
disp
End Sub

Private Sub Command6_Click()

If bt = 1 Then
rs.AddNew
ElseIf bt = 2 Then
rs.Edit
End If
rs(0) = Text1.Text
rs(1) = Val(Text2.Text)
rs.Update
Form_Load

End Sub

Private Sub Command7_Click()
X = InputBox("Enter number of rows to  move" & vbCrLf & " (Enter negative values for move back")
On Error Resume Next
HScroll1.Value = HScroll1.Value + X
End Sub

Private Sub Form_Load()

Set db = OpenDatabase(App.Path & "\Database\DirDB.mdb")
Set rs = db.OpenRecordset("ISD")

HScroll1.Max = rs.RecordCount - 1
Label3.Caption = 1 & "/" & rs.RecordCount
rs.MoveFirst
disp
HScroll1.Value = 0

Frame2.Visible = False
Frame1.Visible = True
HScroll1.Visible = True
End Sub

Private Sub HScroll1_Change()
rs.MoveFirst
rs.Move HScroll1.Value
Label3.Caption = HScroll1.Value + 1 & "/" & rs.RecordCount
disp
End Sub
Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -