• 示例:从Table中获取SelectionSet


    从Table中获取SelectionSet

    Tablewindow对象允许你获取被选中的行,下例显示了通过ITablewindow的SelectionSet属性获取Selection对象的方法

    Public Sub GetTableSelection()
        Dim pMxDoc As IMxDocment
        Set pMxDoc = ThisDocument
    'Use the ITableCollection interface on the Map to get at all tables in the current data frame
        Dim pTableCollection As ITableCollection
        Set pTableCollection = pMxDoc.FocusMap
        If pTableCollection.TableCount  1 Then
            MsgBox "There are no tables in the active data frame", vbExclamation
            Exit Sub
        End If
    'Get the first table from the collection
        Dim pTable As ITable
        Set pTable = pTableCollection.Table(0)
        

        Dim pTabWin As ITableWindow
        Dim pOldWin As ITableWindow
        Set pTabWin = New TableWindow
    'Check to see if the table windwo is already open
        Set pOldWin = pTabWin.FinViatable(pTable, False)
        If Not pOldWin Is Nothing Then
            Set pTabWin = pOldWin
        Else
            Set pTabWin.Table = pTable
            Set pTabWin.Application = Application
    'Allow one selected row
            pTabWin.TableSelectionAction = esriSelectCurrentRow
            pTabWin.Show True
        End If
    'Get the SelectionSet
        Dim pSelSet As ISelectionSet
        Set pSelect = pTabWin.SelectonSet
    'Use the SelectionSet property on ITableWin to get the selected records

    'Show the count of selected records in a message box
        MsgBox "The table has " & pSelSet.Count & "selected records"
    End Sub

  • 相关阅读:
    颜色空间之CIE2000色差公式
    爱做梦的人-人的特性之一
    Lua文件操作和串行化
    Lua文件操作和串行化
    Lua调用C++带参数的方法
    Lua调用C++带参数的方法
    C++对Lua中table进行读取、修改和创建
    C++对Lua中table进行读取、修改和创建
    C++获取Lua全局变量和执行Lua多参数多返回值函数
    C++获取Lua全局变量和执行Lua多参数多返回值函数
  • 原文地址:https://www.cnblogs.com/lauer0246/p/SelectionSet.html
Copyright © 2020-2023  润新知