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

📄 frmstdsearch.frm

📁 Online Telephone Directory in Visual Basic
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form5 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   Caption         =   "Form5"
   ClientHeight    =   3195
   ClientLeft      =   0
   ClientTop       =   -105
   ClientWidth     =   4680
   LinkTopic       =   "Form5"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.Frame Frame2 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Search Result"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3615
      Left            =   840
      TabIndex        =   13
      Top             =   7080
      Visible         =   0   'False
      Width           =   13095
      Begin VB.Label Label7 
         BackColor       =   &H0000C0C0&
         Caption         =   "Label7"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   1575
         Left            =   4200
         TabIndex        =   14
         Top             =   720
         Width           =   7695
         WordWrap        =   -1  'True
      End
      Begin VB.Image Image2 
         Height          =   2730
         Left            =   120
         Picture         =   "FrmStdSearch.frx":0000
         Stretch         =   -1  'True
         Top             =   840
         Width           =   2820
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0FFC0&
      Height          =   3375
      Left            =   840
      TabIndex        =   1
      Top             =   3480
      Width           =   13095
      Begin VB.CommandButton Command2 
         BackColor       =   &H00C0FFFF&
         Caption         =   "Reset"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   5520
         Picture         =   "FrmStdSearch.frx":1FFF2
         Style           =   1  'Graphical
         TabIndex        =   12
         Top             =   2640
         Width           =   1935
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0FFFF&
         Caption         =   "Search"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   3360
         Picture         =   "FrmStdSearch.frx":49C04
         Style           =   1  'Graphical
         TabIndex        =   11
         Top             =   2640
         Width           =   1935
      End
      Begin VB.CommandButton Command3 
         BackColor       =   &H00C0FFFF&
         Caption         =   "Home"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   7680
         Picture         =   "FrmStdSearch.frx":73816
         Style           =   1  'Graphical
         TabIndex        =   10
         Top             =   2640
         Width           =   1935
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   6960
         TabIndex        =   8
         Top             =   1560
         Width           =   2775
      End
      Begin VB.OptionButton Option2 
         BackColor       =   &H00C0FFC0&
         Caption         =   "City Code"
         Height          =   255
         Left            =   5160
         TabIndex        =   6
         Top             =   840
         Width           =   1455
      End
      Begin VB.OptionButton Option1 
         BackColor       =   &H00C0FFC0&
         Caption         =   "City Name"
         Height          =   255
         Left            =   3840
         TabIndex        =   5
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "( Do not put Zero  Before the City Code )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   5640
         TabIndex        =   9
         Top             =   2160
         Width           =   2925
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Enter City Name or Code :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   4440
         TabIndex        =   7
         Top             =   1560
         Width           =   2295
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Search By : "
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   2520
         TabIndex        =   4
         Top             =   840
         Width           =   1155
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "View All STD Codes"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   -1  'True
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   240
         Left            =   9720
         MouseIcon       =   "FrmStdSearch.frx":9D428
         MousePointer    =   99  'Custom
         TabIndex        =   3
         Top             =   360
         Width           =   1755
      End
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "S T D Code Search"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   750
      Left            =   4800
      TabIndex        =   2
      Top             =   2520
      Width           =   5565
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Grahambell Telephone Directory"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   27.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   780
      Left            =   2880
      TabIndex        =   0
      Top             =   1200
      Width           =   10320
   End
   Begin VB.Image Image1 
      Height          =   2625
      Left            =   240
      Picture         =   "FrmStdSearch.frx":9D732
      Top             =   0
      Width           =   2355
   End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database, rs As Recordset
Private Sub Command1_Click()
If Option1.Value = True And Text1.Text <> "" Then
Set rs = db.OpenRecordset("Select * from STD where city = '" & UCase(Trim(Text1.Text)) & "'")
    If rs.RecordCount <> 0 Then
    Frame2.Visible = True
    Label7.Caption = "The STD Code for " & rs(0) & " is 0" & rs(1)
    Else
    Frame2.Visible = True
    Label7.Caption = "Please type the correct city name"
    End If
ElseIf Option2.Value = True And Text1.Text <> "" Then
Set rs = db.OpenRecordset("Select * from STD where code = " & Val(Text1.Text))
    If rs.RecordCount <> 0 Then
    rs.MoveLast
    Frame2.Visible = True
    rs.MoveFirst
    Label7.Caption = "The City Name for the STD Code - 0" & rs(1) & " is " & vbCrLf
    While rs.EOF <> True
    Label7.Caption = Label7.Caption & rs(0) & ", "
    rs.MoveNext
    Wend
    Else
    Frame2.Visible = True
    Label7.Caption = "Please type the correct STD Code"
    End If
Else
MsgBox "Enter City Name or STD Code", vbInformation
End If

End Sub

Private Sub Command2_Click()
Option1.Value = True
Text1.Text = ""
Frame2.Visible = False
End Sub

Private Sub Command3_Click()
Unload Me
Form1.Show
End Sub

Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\Database\DirDB.mdb")

End Sub

Private Sub Label3_Click()
Unload Me
Form8.Show
End Sub

⌨️ 快捷键说明

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