NumListCols property (WinStudio scripts)

Applies To

IWSFormComponent interface, list source objects

Definition

Returns an integer indicating the number of columns in a list source entry for components with a list source. Read-only.

Syntax

object.GetNumListCols

  Part   Description
object Required. A reference to a list source component object.

Remarks

The return value is an integer indicating the column number. Column numbers use a zero-based index.

Example

Sub Main()
   Dim iRow As Integer
   Dim iCol As Integer
   Dim iNumListRows As Integer
   Dim iNumListCols As Integer
   Dim strGridColVal As String
   'Get the number of rows in the list and the number of columns in each row
   iNumListRows = ThisForm.Components("comboBox1").NumListRows
   iNumListCols = ThisForm.Components("comboBox1").NumListCols
   Application.ShowMessage("Number of rows: " & _
      iNumListRows.ToString & vbLf & _
      "Number of columns: " & iNumListCols.ToString())
   'Loop through the list.
   For iRow = 0 To iNumListRows - 1
       strGridColVal = ""
       'Loop through the columns in each list entry.
       For iCol = 0 To iNumListCols - 1
           strGridColVal = strGridColVal + "" + _
           ThisForm.Components("comboBox1").GetListValue(iRow, iCol)
       Next iCol
       Application.ShowMessage("Row " & (iRow + 1).ToString() & ": " & strGridColVal)
   Next iRow
End Sub