TX Text Control column selection In version 17.0, a long-desired feature has been implemented: Selecting a table column. While in the .NET counterpart of TX Text Control, the TableColumn object has a Select method to select the column programmatically, the ActiveX version offers the TableCellStart property to get the start and end positions of specific table cells.

In order to select a specific table column, the SelStart and SelLength properties must be used. The following VB6 code shows how to select a specific table column:

Private Sub SelectTableColumn(TableID As Integer, Col As Integer)
    Dim iTableRows As Integer
    iTableRows = TXTextControl1.TableRows(TableID)

    TXTextControl1.SelStart = TXTextControl1.TableCellStart(TableID, 1, Col) - 1
    TXTextControl1.SelLength = TXTextControl1.TableCellStart _
        (TableID, iTableRows, Col) - _
        TXTextControl1.TableCellStart(TableID, 1, Col)
End Sub

To complete this topic, the following code shows how to select a complete row:

Private Sub SelectTableRow(TableID As Integer, Row As Integer)
    Dim iTableCols As Integer
    iTableCols = TXTextControl1.TableRows(TableID)

    TXTextControl1.SelStart = TXTextControl1.TableCellStart(TableID, Row, 1) - 1
    TXTextControl1.SelLength = TXTextControl1.TableCellStart _
        (TableID, Row, iTableCols) - _
        TXTextControl1.TableCellStart(TableID, Row, 1)
End Sub

If you have not downloaded version 17.0 yet, feel free to test the fully functional 60-day trial version:

Fully Featured, 30 Day Trial Versions

Happy coding, folks!