The Columns collection of TableColumn objects
contains all the columns in the TableWindow. It is
accessible by the Columns property of the TableWindow
object. The Columns collection's methods and properties allow iterating through the columns,
adding and removing columns from the collection and controlling the table caption.
As any collection the Columns has a Count property
that returns the total number of columns in the table, and Item
method returns the desired TableColumn from the collection. Using the Item method
you can index a column by its serial number (the number of the first (leftmost) column is 1, the
last (rightmost) has the number equal to Columns.Count), or by the physical quantity it
shows as QfQuantity. The Item
is a default method of the Columns collection, so its can be simply omitted. You cannot
change the order that columns appear in the table - it is hard coded for each problem type.
Columns collection provides the following methods and properties:
Turns on and off the quantity verbal description in the table caption.
The following example creates the TableWindow, shows the
verbal description of the quantities and adjusts the columns width by header. Then it removes
the first 10 columns from the table and inserts a column that shows the point distance from the
contour starting point.
Dim res As QuickField.Result
Dim cont As QuickField.Contour
.......
Dim table As QuickField.TableWindow
Dim col As QuickField.TableColumn
Set table = res.GetTable(cont)
table.Columns.ShowDescription = True
table.Columns.SetWidth (qfByHeader)
For i = 1 To 10
Set col = table.Columns(1) ' get the leftmost column
If Not col Is Nothing Then
table.Columns.Remove col
' and remove it
End If
Next
Set col = table.Columns.Add(qfCoordL)