Products Technologies Demo Docs Blog Support Company

Selecting Table Columns Using TX Text Control ActiveX

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…

Selecting Table Columns Using TX Text Control ActiveX

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!

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

Windows FormsWPF.NET

Create a Table of Contents in Windows Forms using C#

This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.


ASP.NETWindows FormsWPF

Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub

This article gives a quick overview of the new repositories, their structure and our plans for the future.


ASP.NETJavaScriptDocument Editor

Detect Toggle Button Changes Using a MutationObserver

This article shows how to detect changes of toggle buttons in the ribbon of the web editor using a MutationObserver. The state of a toggle button in the ribbon visualizes the state of a certain…


Windows FormsList.NET

Two Ways to Restart Numbered Lists in TX Text Control

In TX Text Control, numbered lists are continued by default and need to be reset when required. There is more than one way if you want to restart numbered lists in a document. In this article, two…


Windows FormsSampleShortcuts

Zoom Tricks: Disabling CTRL + MOUSE WHEEL and More

This article shows how to disable CTRL + MOUSE WHEEL, implement zooming with keyboard and reset the zoom factor to its default value.