removetheme.frm

来自「GIS地理信息系统开发。大名鼎鼎的MAPX+VisualBasic6.0软件开发」· FRM 代码 · 共 119 行

FRM
119
字号
VERSION 5.00
Begin VB.Form RemoveTheme 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Remove Themes"
   ClientHeight    =   3795
   ClientLeft      =   1140
   ClientTop       =   1515
   ClientWidth     =   6285
   Icon            =   "RemoveTheme.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3795
   ScaleWidth      =   6285
   ShowInTaskbar   =   0   'False
   Begin VB.ListBox lstThemes 
      Height          =   2400
      Left            =   180
      MultiSelect     =   2  'Extended
      TabIndex        =   1
      Top             =   420
      Width           =   5835
   End
   Begin VB.CommandButton cmdRemove 
      Caption         =   "&Remove"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   375
      Left            =   1860
      TabIndex        =   3
      Top             =   3240
      Width           =   1215
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "&Cancel"
      Height          =   375
      Left            =   3240
      TabIndex        =   2
      Top             =   3240
      Width           =   1215
   End
   Begin VB.Label lblPickUp 
      Caption         =   "&Pick up themes to remove:"
      Height          =   255
      Left            =   180
      TabIndex        =   0
      Top             =   120
      Width           =   2355
   End
End
Attribute VB_Name = "RemoveTheme"
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.

Dim gMap As Map, TD() As ThemeDescr

Public Sub Activate(Map As Map)
  Set gMap = Map
  InitThemes
  If UBound(TD) = 0 Then
    Exit Sub
  End If
  FormToCenter hWnd
  Show 1
End Sub

Private Sub InitThemes()
  Dim i As Integer

  FillThemes TD, gMap
  lstThemes.Clear
  For i = 1 To UBound(TD)
    lstThemes.AddItem TD(i).ThemeString
  Next
End Sub

Private Sub cmdCancel_Click()
  Hide
End Sub

Private Sub cmdRemove_Click()
  Dim iThemeNum As Integer, i As Integer, j As Integer, iThemes As Integer

  iThemeNum = 0
  For i = 1 To gMap.Datasets.Count
    iThemes = 0
    For j = 1 To gMap.Datasets(i).Themes.Count
      If lstThemes.Selected(iThemeNum) Then
        gMap.Datasets(i).Themes.Remove j - iThemes
        iThemes = iThemes + 1
      End If
      iThemeNum = iThemeNum + 1
    Next
  Next

  Hide
End Sub

Private Sub lstThemes_Click()
  cmdRemove.Enabled = (lstThemes.SelCount > 0)
End Sub

Private Sub lstThemes_DblClick()
  If lstThemes.SelCount = 1 Then
    cmdRemove_Click
  End If
End Sub

⌨️ 快捷键说明

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