📄 查询图层.txt
字号:
Dim _findLayerName As String = "Area"
Dim find As MapInfo.Data.Find.Find = Nothing
Try
Dim map As Map = MapInfo.Engine.Session.Current.MapFactory(MapControl1.MapAlias)
If (MapInfo.Engine.Session.Current.MapFactory.Count = 0) Then
Return
End If
If (map Is Nothing) Then
Return
End If
Dim findLayer As FeatureLayer = map.Layers(_findLayerName)
find = New MapInfo.Data.Find.Find(findLayer.Table, findLayer.Table.TableInfo.Columns("Position"))
Dim result As FindResult = find.Search(TextBox1.Text)
If result.ExactMatch Then
'Create a Feature(point) for the location we found.
map.Center = New DPoint(result.FoundPoint.X, result.FoundPoint.Y)
TextBox1.Text = "找到!"
Else
TextBox1.Text = "未找到!"
End If
find.Dispose()
Catch ex As Exception
TextBox1.Text = ex.Message
If Not find Is Nothing Then
find.Dispose()
End If
End Try
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -