📄 bufferesult.frm
字号:
VERSION 5.00
Begin VB.Form bufferesult
Caption = "缓冲区查询结果"
ClientHeight = 4410
ClientLeft = 4185
ClientTop = 3030
ClientWidth = 4200
LinkTopic = "Form1"
ScaleHeight = 4410
ScaleWidth = 4200
Begin VB.ListBox List1
Height = 2595
Left = 600
TabIndex = 1
Top = 1320
Width = 3015
End
Begin VB.ComboBox Combo1
Height = 315
Left = 600
TabIndex = 0
Text = "请选择地物类型"
Top = 360
Width = 2895
End
Begin VB.Label Label1
Height = 255
Left = 600
TabIndex = 2
Top = 840
Width = 2895
End
End
Attribute VB_Name = "bufferesult"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Dim n As Integer
Dim layer As MapObjects2.MapLayer
Dim record As MapObjects2.Recordset
Private Sub bufferresult()
List1.Clear
For i = 0 To 缓冲区分析.Map1.Layers.Count - 1
If 缓冲区分析.Map1.Layers(i).Name = Combo1.Text Then
Set rectbuffer = 缓冲区分析.Map1.Layers(i).SearchShape(bufferpolygon, moEdgeTouchOrAreaIntersect, "")
rectbuffer.MoveFirst
While Not rectbuffer.EOF
List1.AddItem rectbuffer.Fields("name").ValueAsString
rectbuffer.MoveNext
Wend
End If
Next i
End Sub
Private Sub Combo1_Click()
Call bufferresult
Label1.Caption = "在缓冲区多边形内的" & Combo1.Text & "包括:"
End Sub
Private Sub Form_Load()
Me.Move 缓冲区分析.Left + 缓冲区分析.Width, 缓冲区分析.Top
If (Me.Left + Me.Width) > Screen.Width Then
Me.Left = Screen.Width - Me.Width
End If
For i = 0 To 缓冲区分析.Map1.Layers.Count - 1
Combo1.AddItem 缓冲区分析.Map1.Layers(i).Name
Next i
End Sub
Private Sub List1_Click()
Dim record As MapObjects2.Recordset
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
For n = 0 To 缓冲区分析.Map1.Layers.Count - 1
If 缓冲区分析.Map1.Layers(n).Name = Combo1.Text Then
Set record = 缓冲区分析.Map1.Layers(n).Records
record.MoveFirst
While Not record.EOF
If record.Fields("name").ValueAsString = List1.List(i) Then
缓冲区分析.Map1.FlashShape record.Fields("shape").Value, 4
End If
record.MoveNext
Wend
End If
Next n
End If
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -