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

📄 frmmodifylegend.frm

📁 GIS地理信息系统开发。大名鼎鼎的MAPX+VisualBasic6.0软件开发
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmModifyLegend 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Pick a Legend to Modify"
   ClientHeight    =   1455
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   3690
   Icon            =   "frmModifyLegend.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1455
   ScaleWidth      =   3690
   ShowInTaskbar   =   0   'False
   Begin VB.ComboBox LegendCombo 
      Height          =   315
      Left            =   240
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   480
      Width           =   3255
   End
   Begin VB.CommandButton CancelButton 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   1920
      TabIndex        =   1
      Top             =   960
      Width           =   1215
   End
   Begin VB.CommandButton OKButton 
      Caption         =   "Modify..."
      Default         =   -1  'True
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   960
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "Legend to Modify:"
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   240
      Width           =   1815
   End
End
Attribute VB_Name = "frmModifyLegend"
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 thm As Theme
    Dim DatasetNumber As Integer
    Dim ComboItemNumber As Integer
    ComboItemNumber = 0 ' This stores the index of the
                        ' current item.
    
    ' Since every theme has a legend (although it may be
    ' invisble, we just list every theme in the combobox.
    ' We use a trick: to store which dataset each legend
    ' belongs to, we use the ItemData field of the
    ' combobox to store the index of the dataset.
    
    ' First, loop over each dataset
    For DatasetNumber = 1 To fMainForm.Map1.Datasets.Count
        ' Now, for each dataset, loop over every theme on
        ' that dataset
        For Each thm In fMainForm.Map1.Datasets(DatasetNumber).Themes
            ' Add the legend of this them to the combobox,
            ' and set the item data to the dataset number
            LegendCombo.AddItem thm.Name
            LegendCombo.ItemData(ComboItemNumber) = DatasetNumber
            ComboItemNumber = ComboItemNumber + 1
        Next
    Next
    
    LegendCombo.ListIndex = 0
End Sub

Private Sub OKButton_Click()
    Dim DatasetNumber As Integer
    ' Retrieve the index of the dataset from the ItemData
    ' field of the combobox
    DatasetNumber = LegendCombo.ItemData(LegendCombo.ListIndex)
    Unload Me
    ' Display the LegendDlg (Builtin MapX Legend Modification dialog)
    fMainForm.Map1.Datasets(DatasetNumber).Themes(LegendCombo.Text).Legend.LegendDlg
End Sub

⌨️ 快捷键说明

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