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

📄 frmsearchset.frm

📁 GIS+VB开发. GIS+VB开发.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmSearchSet 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "查询设置"
   ClientHeight    =   2535
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4140
   Icon            =   "FrmSearchSet.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2535
   ScaleWidth      =   4140
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.CheckBox Check1 
      Caption         =   "图层可选"
      Height          =   255
      Left            =   2280
      TabIndex        =   2
      Top             =   480
      Width           =   1695
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   2280
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   60
      Width           =   1815
   End
   Begin VB.ListBox List1 
      Height          =   2400
      ItemData        =   "FrmSearchSet.frx":1E72
      Left            =   60
      List            =   "FrmSearchSet.frx":1E74
      TabIndex        =   0
      Top             =   60
      Width           =   2175
   End
   Begin VB.Label Label1 
      Caption         =   "设置模糊查询时所查询的字段。如果图层不可选,则不查询该图层。"
      Height          =   735
      Left            =   2280
      TabIndex        =   3
      Top             =   1800
      Width           =   1815
   End
End
Attribute VB_Name = "FrmSearchSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
Dim IntAA As Integer, IntBB As Integer
Dim TempLayer As MapXLib.Layer
Dim TempDataset As MapXLib.Dataset
Set TempLayer = FrmMain.MyMap.Layers(List1.List(List1.ListIndex))
If Check1.Value = 0 Then
TempLayer.Selectable = False
Combo1.Clear
End If
If Check1.Value = 1 Then
TempLayer.Selectable = True
Combo1.Clear
Set TempDataset = FrmMain.MyMap.DataSets.Add(miDataSetLayer, TempLayer)
For Each TempField In TempDataset.Fields
  Combo1.AddItem TempField.Name
Next
For IntAA = 1 To Combo1.ListCount
  If Combo1.List(IntAA - 1) = TempLayer.KeyField Then Combo1.ListIndex = IntAA - 1
Next IntAA
End If
End Sub

Private Sub Combo1_Validate(Cancel As Boolean)
Dim TempLayer As MapXLib.Layer
Set TempLayer = FrmMain.MyMap.Layers(List1.List(List1.ListIndex))
If TempLayer.KeyField <> Combo1.Text Then TempLayer.KeyField = Combo1.Text
End Sub

Private Sub Form_Load()
Dim ii As Integer
List1.Clear
Combo1.Clear
For ii = 1 To FrmMain.MyMap.Layers.Count
Me.List1.AddItem FrmMain.MyMap.Layers.Item(ii).Name
Next ii
List1.Refresh
End Sub

Private Sub List1_Click()
Dim TempField As MapXLib.Field, TempFields As MapXLib.Fields
Dim TempDataset As MapXLib.Dataset
Dim TempLayer As MapXLib.Layer
Combo1.Clear
Set TempLayer = FrmMain.MyMap.Layers(List1.List(List1.ListIndex))
If TempLayer.Selectable Then
Dim IntAA As Integer, IntBB As Integer
Check1.Value = 1
Combo1.Clear
Set TempDataset = FrmMain.MyMap.DataSets.Add(miDataSetLayer, TempLayer)
For Each TempField In TempDataset.Fields
  Combo1.AddItem TempField.Name
Next
For IntAA = 1 To Combo1.ListCount
  If Combo1.List(IntAA - 1) = TempLayer.KeyField Then Combo1.ListIndex = IntAA - 1
Next IntAA
Else
Check1.Value = 0
End If
End Sub

⌨️ 快捷键说明

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