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

📄 find.frm

📁 这个是grs源程序,mo在图象显示上很好,所以大家一定要下载
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "comctl32.ocx"
Object = "{A8B3B723-0B5A-101B-B22E-00AA0037B2FC}#1.0#0"; "GRID32.OCX"
Begin VB.Form frmFind 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Find Features"
   ClientHeight    =   5925
   ClientLeft      =   1455
   ClientTop       =   825
   ClientWidth     =   4770
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   5925
   ScaleWidth      =   4770
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdZoomto 
      Caption         =   "Zoom To"
      Enabled         =   0   'False
      Height          =   375
      Left            =   3480
      TabIndex        =   11
      Top             =   5400
      Width           =   975
   End
   Begin VB.CommandButton cmdPanto 
      Caption         =   "Pan To"
      Enabled         =   0   'False
      Height          =   375
      Left            =   2520
      TabIndex        =   10
      Top             =   5400
      Width           =   855
   End
   Begin VB.CommandButton cmdInsertPin 
      Caption         =   "Insert Pin"
      Enabled         =   0   'False
      Height          =   375
      Left            =   1440
      TabIndex        =   9
      Top             =   5400
      Width           =   975
   End
   Begin VB.Frame frm2 
      Height          =   3375
      Left            =   120
      TabIndex        =   1
      Top             =   2520
      Width           =   4575
      Begin VB.CommandButton cmdHighlight 
         Caption         =   "Highlight"
         Enabled         =   0   'False
         Height          =   375
         Left            =   120
         TabIndex        =   8
         Top             =   2880
         Width           =   1095
      End
      Begin MSGrid.Grid grdFeatList 
         Height          =   1695
         Left            =   120
         TabIndex        =   12
         Top             =   600
         Width           =   4215
         _Version        =   65536
         _ExtentX        =   7435
         _ExtentY        =   2990
         _StockProps     =   77
         ForeColor       =   0
         BackColor       =   16777215
         Cols            =   3
         FixedCols       =   0
      End
      Begin VB.Label lblNumFeats 
         Alignment       =   1  'Right Justify
         Caption         =   "0 matches found"
         Height          =   255
         Left            =   2520
         TabIndex        =   13
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label lbl1 
         Caption         =   "4. Select the operation to perform"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   7
         Top             =   2520
         Width           =   2415
      End
      Begin VB.Label lbl1 
         Caption         =   "3. Pick a feature"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   6
         Top             =   240
         Width           =   1335
      End
   End
   Begin VB.Frame frm1 
      Height          =   2415
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   4575
      Begin VB.CommandButton cmdFindButton 
         Caption         =   "Find"
         Enabled         =   0   'False
         Height          =   375
         Left            =   3240
         TabIndex        =   5
         Top             =   1200
         Width           =   1095
      End
      Begin VB.ComboBox cboSearchList 
         Height          =   315
         Left            =   120
         TabIndex        =   3
         Text            =   "Combo1"
         Top             =   480
         Width           =   4215
      End
      Begin ComctlLib.ListView lvwLayerList 
         Height          =   1035
         Left            =   120
         TabIndex        =   14
         Top             =   1200
         Width           =   2895
         _ExtentX        =   5106
         _ExtentY        =   1826
         View            =   3
         LabelWrap       =   -1  'True
         HideSelection   =   -1  'True
         HideColumnHeaders=   -1  'True
         _Version        =   327682
         SmallIcons      =   "imlstListView"
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         BorderStyle     =   1
         Appearance      =   1
         NumItems        =   1
         BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Text            =   "Layer"
            Object.Width           =   3528
         EndProperty
      End
      Begin ComctlLib.ImageList imlstListView 
         Left            =   3720
         Top             =   1800
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   45
         ImageHeight     =   15
         MaskColor       =   16711935
         _Version        =   327682
         BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
            NumListImages   =   8
            BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":0000
               Key             =   ""
            EndProperty
            BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":0722
               Key             =   ""
            EndProperty
            BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":0E44
               Key             =   ""
            EndProperty
            BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":1566
               Key             =   ""
            EndProperty
            BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":1C88
               Key             =   ""
            EndProperty
            BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":23AA
               Key             =   ""
            EndProperty
            BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":2ACC
               Key             =   ""
            EndProperty
            BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
               Picture         =   "Find.frx":31EE
               Key             =   ""
            EndProperty
         EndProperty
      End
      Begin VB.Label lbl1 
         Caption         =   "2. Choose which layers to search"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   4
         Top             =   960
         Width           =   2535
      End
      Begin VB.Label lbl1 
         Caption         =   "1. Enter a search string"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   2
         Top             =   240
         Width           =   1695
      End
   End
End
Attribute VB_Name = "frmFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Recs2() As MapObjects2.Recordset
Dim layerName() As String
Dim layerNum() As Integer
Dim f_Action As String
Dim LayerStatus() As Integer
'
'THIS FORM FINDS THE FEATURES WITHIN ALL LAYERS
'THAT CONTAIN THE SEARCH STRING WITHIN THEIR
'ATTRIBUTE TABLES.  ALL LAYERS, NOT JUST THE ACTIVE LAYER.
'

Private Sub rebuildListView()
  'This procedure rebuilds the list view from the current layer list. The process
  'is to iterate through the Layers collection and insert each layer into a ListItem
  'object, and then insert the ListItem into the Listview.
    
  'Clear the list view
  lvwLayerList.ListItems.Clear
    
  'Get the number of layers in the Layers collection.
  Dim numLayers As Integer
  numLayers = frmMain.mapDisp.Layers.count
  
  Dim curLayer As Object       'declared as object because it might be MapLayer or ImageLayer
  Dim curLayerIndex As Integer 'index value of current layer in Layers collection
  Dim curLayerName As String   'name of current layer
  Dim curLayerType As Integer  'whether MapLayer or ImageLayer type
  Dim curShapeType As Integer  'whether point, line or polygon MapLayer
  Dim curListItem As ListItem  'ListItem that represents current layer
  Dim iconIndex As Integer     'index for drawing icon for visibility state and type
    
  Dim i As Integer
  For i = 0 To numLayers - 1
    Set curLayer = frmMain.mapDisp.Layers(i)
    curLayerName = curLayer.Name
    curLayerType = curLayer.LayerType
    If curLayerType = moMapLayer Then
      curShapeType = curLayer.shapeType
    End If
    
    'In the image list, these are the icons assigned:
    '  1 - Checked points     5 - Unchecked points
    '  2 - Checked lines      6 - Unchecked lines
    '  3 - Checked polygons   7 - Unchecked polygons
    '  4 - Checked images     8 - Unchecked images
    'This code block translates the layer type, shape type,
    'and visibility status into an index for one of these icons.
    If curLayerType = moImageLayer Then
      iconIndex = 4
    ElseIf curLayerType = moMapLayer Then
      If curShapeType = moShapeTypePoint Then iconIndex = 1
      If curShapeType = moShapeTypeLine Then iconIndex = 2
      If curShapeType = moShapeTypePolygon Then iconIndex = 3
    End If
    If LayerStatus(i) = 0 Then iconIndex = iconIndex + 4
      
    'Add the ListItem representing the layer and set its selected state to false
    If iconIndex <> 4 And iconIndex <> 8 Then
      Set curListItem = lvwLayerList.ListItems.Add(, , curLayerName, , iconIndex)
    End If
  Next i

End Sub

Private Sub check_cmdFindButton()

'If any layer is selected and the search list is not empty,
'then enable the Find button
  frmFind.cmdFindButton.Enabled = False
  If Not IsNull(frmFind.cboSearchList.text) Then
    Dim i As Integer
    For i = 0 To frmMain.mapDisp.Layers.count - 1
      If LayerStatus(i) = 1 And frmFind.cboSearchList.text <> "" Then
        frmFind.cmdFindButton.Enabled = True
        Exit For
      End If
    Next i
  End If

End Sub

Private Sub toggleCheckbox()

'When a layer in the ListView is selected, unselect all others.
  Dim selItem As Integer
  selItem = lvwLayerList.SelectedItem.Index - 1
  If LayerStatus(selItem) = 1 Then
    LayerStatus(selItem) = 0
  Else
    LayerStatus(selItem) = 1
  End If

⌨️ 快捷键说明

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