📄 viewentirelayers.frm
字号:
VERSION 5.00
Begin VB.Form viewentirelayers
Caption = "Form1"
ClientHeight = 1935
ClientLeft = 60
ClientTop = 450
ClientWidth = 3810
LinkTopic = "Form1"
ScaleHeight = 1935
ScaleWidth = 3810
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton OKButton
Caption = "OK"
Default = -1 'True
Height = 375
Left = 720
TabIndex = 2
Top = 1200
Width = 1215
End
Begin VB.CommandButton CancelButton
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 2040
TabIndex = 1
Top = 1200
Width = 1215
End
Begin VB.ComboBox LayerCombo
Height = 300
Left = 360
Style = 2 'Dropdown List
TabIndex = 0
Top = 600
Width = 3135
End
Begin VB.Label Label1
Caption = "View Entire Layer:"
Height = 255
Left = 360
TabIndex = 3
Top = 240
Width = 1695
End
End
Attribute VB_Name = "viewentirelayers"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' This sample application and corresponding sample code is provided
' for example purposes only. It has not undergone rigorous testing
' and as such should not be shipped as part of a final application
' without extensive testing on the part of the organization releasing
' the end-user product.
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim lyr As MapXLib.Layer
For Each lyr In MapBrower.Map1.Layers
LayerCombo.AddItem lyr.Name
Next
LayerCombo.AddItem "All Layers"
LayerCombo.ListIndex = 1
End Sub
Private Sub OKButton_Click()
' Since layer bounds are expressed in the NumericCoordSys and
' map bounds are expressed in the DisplayCoordSys, we make the
' coordinate systems identical here. If we didn't, the new view
' would be incorrect
Set MapBrower.Map1.NumericCoordSys = MapBrower.Map1.DisplayCoordSys
If LayerCombo.Text = "All Layers" Then
Set MapBrower.Map1.Bounds = MapBrower.Map1.Layers.Bounds
Else
Dim LayerName As String
LayerName = LayerCombo.Text
Set MapBrower.Map1.Bounds = MapBrower.Map1.Layers(LayerName).Bounds
End If
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -