⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 有关VB在GIS空间分析方面的应用 深入详解代码大家在这方面多交流啊
💻 FRM
字号:
VERSION 5.00
Object = "{C552EA90-6FBB-11D5-A9C1-00104BB6FC1C}#1.0#0"; "MapControl.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   11010
   ScaleWidth      =   15240
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Command2 
      Caption         =   "Full Extent"
      Height          =   615
      Left            =   4800
      TabIndex        =   1
      Top             =   8280
      Width           =   2175
   End
   Begin esriMapControl.MapControl MapControl1 
      Height          =   7575
      Left            =   480
      OleObjectBlob   =   "Form1.frx":0000
      TabIndex        =   0
      Top             =   480
      Width           =   10815
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
  MapControl1.Extent = MapControl1.FullExtent
End Sub

Private Sub Form_Load()
  Dim pLayer As ILayer
  Dim i As Integer
    'Loop through the MapControl layers
  For i = 0 To MapControl1.LayerCount - 1
    Set pLayer = MapControl1.Layer(i)
    'Set scale thresholds
   If UCase(pLayer.Name) = "COUNTIES " Then
      pLayer.MinimumScale = 0#
      pLayer.MaximumScale = 15000000#
      
   ElseIf UCase(pLayer.Name) = "STATES" Then
     pLayer.MinimumScale = 0#
     pLayer.MaximumScale = 14999999#
     
   End If
 Next i

End Sub

Private Sub MapControl1_OnMouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long, ByVal mapX As Double, ByVal mapY As Double)
   If button = vbLeftButton Then
     MapControl1.Extent = MapControl1.TrackRectangle
   ElseIf button = vbRightButton Then
     MapControl1.Pan
   End If
   
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -