📄 frm_province_zhejiang.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 = 7380
TabIndex = 4
Top = 5310
Width = 950
End
Begin VB.Frame Frame1
Height = 1185
Left = 6750
TabIndex = 1
Top = 3600
Width = 2430
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 = 6795
TabIndex = 0
Top = 195
Width = 2430
End
End
Attribute VB_Name = "Frm_Province_Zhejiang"
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_zhejiang_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case Index
Case 0
'湖州市
Mystr = "湖州市"
Lbl_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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_Zhejiang(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 = 4500
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_Zhejiang(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 + -