TXTextControl.TableCollection Class

An instance of the TableCollection class contains all tables of a Text Control document or part of the document represented through objects of the type Table. It can be obtained with the TextControl.Tables, HeaderFooter.Tables or TextFrame.Tables property. The TableCollection class is derived from the TableBaseCollection class and implements therefore the IEnumerable and the ICollection interfaces. Additionally to the properties and methods inherited it implements the following:

Syntax

[C#]
public sealed class TableCollection: TableBaseCollection
[Visual Basic]
Public NotInheritable Class TableCollection
  Inherits TableBaseCollection

Properties

Property Description
CanAdd Gets a value indicating whether a new table can be inserted at the current input position.
GridLines Gets or sets a value indicating wether table grid lines are shown or not.

Methods

Method Description
Add Overloaded. Adds a new table at the current text input position.
GetItem Gets the table at the current input position.
Remove Removes the table at the current text input position.

Example

The following example shows how to handle the table collection.

[C#]
int myTableId = 10;
textControl1.Tables.GridLines = false;

if(textControl1.Tables.CanAdd)
  textControl1.Tables.Add(5, 3, myTableId);

TXTextControl.Table myTable = textControl1.Tables.GetItem(myTableId);
textControl1.Tables.Remove(myTableId);
[Visual Basic]
Dim MyTableId As Integer = 10
TextControl1.Tables.GridLines = False

If TextControl1.Tables.CanAdd Then
  TextControl1.Tables.Add(5, 3, MyTableId)
End If

Dim MyTable As TXTextControl.Table = TextControl1.Tables.GetItem(MyTableId)
TextControl1.Tables.Remove(MyTableId)

See Also