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

📄 frmsql.frm

📁 vb+mapxvb+mo二次开发实现鹰眼功能
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmSQL 
   Caption         =   "FrmSQL"
   ClientHeight    =   3855
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6045
   LinkTopic       =   "Form1"
   ScaleHeight     =   3855
   ScaleWidth      =   6045
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "取 消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3600
      TabIndex        =   7
      Top             =   3000
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确 定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1200
      TabIndex        =   6
      Top             =   3000
      Width           =   1215
   End
   Begin VB.ComboBox Combo4 
      Height          =   300
      ItemData        =   "FrmSQL.frx":0000
      Left            =   4560
      List            =   "FrmSQL.frx":00A3
      TabIndex        =   5
      Top             =   2280
      Width           =   1215
   End
   Begin VB.ComboBox Combo3 
      Height          =   300
      ItemData        =   "FrmSQL.frx":024C
      Left            =   4560
      List            =   "FrmSQL.frx":0262
      TabIndex        =   4
      Top             =   1800
      Width           =   1215
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      ItemData        =   "FrmSQL.frx":0288
      Left            =   4560
      List            =   "FrmSQL.frx":02A1
      TabIndex        =   3
      Top             =   1320
      Width           =   1215
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   4560
      TabIndex        =   2
      Top             =   840
      Width           =   1215
   End
   Begin VB.ComboBox Combo0 
      Height          =   300
      ItemData        =   "FrmSQL.frx":02BD
      Left            =   4560
      List            =   "FrmSQL.frx":02BF
      TabIndex        =   1
      Top             =   360
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2415
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   3255
   End
   Begin VB.Label Label5 
      Caption         =   " 函数"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3720
      TabIndex        =   12
      Top             =   2280
      Width           =   735
   End
   Begin VB.Label Label4 
      Caption         =   " 聚合"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3720
      TabIndex        =   11
      Top             =   1800
      Width           =   855
   End
   Begin VB.Label Label3 
      Caption         =   "运算符"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3720
      TabIndex        =   10
      Top             =   1320
      Width           =   735
   End
   Begin VB.Label Label2 
      Caption         =   "  列"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3720
      TabIndex        =   9
      Top             =   840
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   " 表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3840
      TabIndex        =   8
      Top             =   360
      Width           =   615
   End
End
Attribute VB_Name = "FrmSQL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim bClick As Boolean
Private Sub Combo0_Click()
    If (bClick = True) Then
        Dim ds As MapXLib.Dataset
        Dim fld As MapXLib.Field
    
        Set ds = FormMain.Map1.DataSets.Add(miDataSetLayer, FormMain.Map1.Layers.Item(Combo0.List(Combo0.ListIndex)))
        
        For Each fld In ds.Fields
            Combo1.AddItem fld.Name
        Next
        Combo1.AddItem "obj"
        Combo1.ListIndex = 0
        
        Set ds = Nothing
        Set fld = Nothing
    End If
End Sub


Private Sub Combo1_Click()
    Text1.Text = Text1.Text + " " + Trim(Combo1.Text)
End Sub

Private Sub Combo2_Click()
    If Trim(LCase(Combo2.Text)) = "like" Then
        Text1.Text = Text1.Text + " " + Trim(Combo2.Text) + "%"
    Else
        Text1.Text = Text1.Text + " " + Trim(Combo2.Text)
    End If
End Sub

Private Sub Combo3_Click()
    Text1.Text = Text1.Text + "," + Trim(Combo3.Text) + "()"
End Sub


Private Sub Combo4_Click()
    Text1.Text = Text1.Text + " " + Trim(Combo4.Text) + "()"
End Sub




Private Sub Command1_Click()
  Dim ds As MapXLib.Dataset
    Dim lyr As MapXLib.Layer
    Dim ftrs As MapXLib.Features
    Dim strs As String
    Dim ftr As New MapXLib.Feature
    Dim V As New MapXLib.Variables

    
    Set ds = FormMain.Map1.DataSets.Add(miDataSetLayer, FormMain.Map1.Layers.Item(Combo0.List(Combo0.ListIndex)))
    Set lyr = ds.Layer
    strs = Trim(Text1.Text) '文本框输入-state="AL"
    
    Set ftr = FormMain.Map1.Layers.Item(Combo0.List(Combo0.ListIndex)).AllFeatures.Item(1)
    V.Add "f", ftr
    Set ftrs = lyr.Search(strs, V)
    
    lyr.Selection.ClearSelection
    lyr.Selection.Replace ftrs
    
    
    Set ds = Nothing
    Set lyr = Nothing
    Set ftrs = Nothing
    Set ftr = Nothing
    Unload Me
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
    Dim I As Integer

    bClick = False
   
    For I = 1 To FormMain.Map1.Layers.Count
        Combo0.AddItem FormMain.Map1.Layers.Item(I).Name
    Next
    bClick = True
    Combo0.ListIndex = 0

End Sub

⌨️ 快捷键说明

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