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

📄 layer2dataset.frm

📁 GIS地理信息系统开发。大名鼎鼎的MAPX+VisualBasic6.0软件开发
💻 FRM
字号:
VERSION 5.00
Begin VB.Form layer2datasetForm 
   Caption         =   "Choose Layer to make into dataset"
   ClientHeight    =   2880
   ClientLeft      =   3720
   ClientTop       =   3645
   ClientWidth     =   4785
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   2880
   ScaleWidth      =   4785
   Begin VB.CommandButton closeButton 
      Caption         =   "Close"
      Height          =   495
      Left            =   3360
      TabIndex        =   3
      Top             =   1800
      Width           =   1215
   End
   Begin VB.CommandButton makeDatasetButton 
      Caption         =   "Make Dataset"
      Height          =   495
      Left            =   3360
      TabIndex        =   2
      Top             =   720
      Width           =   1215
   End
   Begin VB.ListBox layerList 
      Height          =   2010
      ItemData        =   "layer2dataset.frx":0000
      Left            =   120
      List            =   "layer2dataset.frx":0002
      TabIndex        =   0
      Top             =   600
      Width           =   2895
   End
   Begin VB.Label layerListLabel 
      AutoSize        =   -1  'True
      Caption         =   "Map Layers"
      Height          =   195
      Left            =   120
      TabIndex        =   1
      Top             =   240
      Width           =   825
   End
End
Attribute VB_Name = "layer2datasetForm"
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.

Public curMap As Object

Private Sub closeButton_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    Dim lyr As MapXLib.Layer
    Set curMap = FindMain.Map1
    ' Add all layers to listbox
    For Each lyr In curMap.Layers
        If lyr.Datasets.Count = 0 Then
            layerList.AddItem lyr.Name
        End If
    Next
    layerList.ListIndex = 0
    Set lyr = Nothing
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set curMap = Nothing
End Sub

Private Sub layerList_DblClick()
    Call makeDataset
End Sub


Public Sub makeDataset()
    Dim lyr As MapXLib.Layer
    If layerList.ListIndex = -1 Then
        MsgBox "Please select a layer to add"
        Exit Sub
    End If
    
    Set lyr = curMap.Layers(layerList.Text)
    
On Error GoTo bottom
    ' Make the layer into a dataset
    curMap.Datasets.Add miDataSetLayer, lyr, lyr.Name
    
    layerList.RemoveItem layerList.ListIndex
    
    Set lyr = Nothing
    Exit Sub
bottom:
    If Err.Number = 1006 Then
        MsgBox lyr.Name & " dataset has already been created."
    Else
        MsgBox Err.Description
    End If
End Sub

Private Sub makeDatasetButton_Click()
    Call makeDataset
End Sub

⌨️ 快捷键说明

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