📄 frm_province_hebei.frm
字号:
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.CommandButton Cmd_Exit
Caption = "关闭退出"
Height = 375
Left = 5925
TabIndex = 4
Top = 6075
Width = 950
End
Begin VB.Frame Frame1
Height = 1185
Left = 5385
TabIndex = 1
Top = 4455
Width = 2325
Begin VB.OptionButton Otn_Lb
Caption = "列表显示"
Height = 285
Left = 555
TabIndex = 3
Top = 750
Width = 1215
End
Begin VB.OptionButton Otn_Dt
Caption = "地图显示"
Height = 315
Left = 540
TabIndex = 2
Top = 285
Value = -1 'True
Width = 1305
End
End
Begin VB.Label Lbl_Info
Caption = "Lbl_Info"
Height = 1350
Left = 5355
TabIndex = 0
Top = 540
Width = 2445
End
End
Attribute VB_Name = "Frm_Province_Hebei"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim Mystr As String
Private Sub Cmd_Exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Lbl_Info.Caption = ""
Adodc1.ConnectionString = PublicStr
End Sub
Private Sub Lbl_Hebei_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case Index
Case 0
'邯郸市
Mystr = "邯郸市"
Lbl_Hebei(0).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "邯郸市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 1
'邢台市
Mystr = "邢台市"
Lbl_Hebei(1).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "邢台市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 2
'衡水市
Mystr = "衡水市"
Lbl_Hebei(2).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "衡水市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 3
'石家庄市
Mystr = "石家庄市"
Lbl_Hebei(3).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "石家庄 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 4
'沧州市
Mystr = "沧州市"
Lbl_Hebei(4).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "沧州市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 5
'保定市
Mystr = "保定市"
Lbl_Hebei(5).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "保定市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 6
'廊坊市
Mystr = "廊坊市"
Lbl_Hebei(6).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "廊坊市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 7
'唐山市
Mystr = "唐山市"
Lbl_Hebei(7).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "唐山市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 8
'秦皇岛市
Mystr = "秦皇岛市"
Lbl_Hebei(8).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "秦皇岛 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 9
'承德市
Mystr = "承德市"
Lbl_Hebei(9).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "承德市 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
Case 10
'张家口市
Mystr = "张家口市"
Lbl_Hebei(10).BorderStyle = 1
rs.Open "select * from tb_Client_csxx where csxx_csmc ='" + Mystr + "'", cnn, adOpenKeyset
If rs.RecordCount > 0 Then
Lbl_Info.Caption = "张家口 邮政编码:" + rs.Fields("csxx_yb") + " 电话区号:" + rs.Fields("csxx_dhqh")
End If
rs.Close
End Select
End Sub
Private Sub Otn_Dt_Click()
'地图显示
If Otn_Dt.Value = True Then
Picture1.Visible = True
Dgr_Yb.Visible = False
Frame2.Visible = False
End If
End Sub
Private Sub Otn_Lb_Click() '列表显示
If Otn_Lb.Value = True Then
Picture1.Visible = False
Dgr_Yb.Visible = True
Dgr_Yb.Top = 200
Dgr_Yb.Left = 200
Dgr_Yb.Height = 5500
Frame2.Visible = True
Txt_Key.Text = ""
Call Dgr_Title
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 0 To 10
Lbl_Hebei(i).BorderStyle = 0
Next i
Lbl_Info.Caption = ""
End Sub
Sub Dgr_Title() '设置DataGrid控件的标题信息
Dgr_Yb.Columns(0).Caption = "省份简称"
Dgr_Yb.Columns(1).Caption = "省份名称"
Dgr_Yb.Columns(2).Caption = "城市名称"
Dgr_Yb.Columns(3).Caption = "邮政编码"
Dgr_Yb.Columns(4).Caption = "电话区号"
End Sub
Private Sub Txt_Key_Change()
Adodc1.RecordSource = "select * from tb_Client_csxx where csxx_sfmc='河北省'and csxx_csmc like +'%'+'" + Txt_Key + "'+'%'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Set Dgr_Yb.DataSource = Adodc1
Call Dgr_Title
Else
Call Dgr_Title
End If
End Sub
Private Sub Txt_Key_GotFocus()
Txt_Key.BackColor = &HFFFF80
End Sub
Private Sub Txt_Key_LostFocus()
Txt_Key.BackColor = &HFFFFFF
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -