GetColumn

Description

Retrieves column information for a DataWindow, child DataWindow, or ListView control.

For syntax for a DataWindow or a child DataWindow, see the GetColumn method for DataWindows in the DataWindow Reference or the online Help.

Applies to

ListView controls

Syntax

listviewname.GetColumn ( index, label, alignment, width )

Argument

Description

listviewname

The name of the ListView control from which you want to find the properties for a column.

index

An integer whose value is the index of the column for which you want to find properties.

label

A string identifying the label of the column for which you want to find properties. This argument is passed by reference.

alignment

A value of the enumerated datatype Alignment specifying the alignment of the column for which you want to find properties. Values are:

  • Center!

  • Justify!

  • Left!

  • Right!

This argument is passed by reference.

width

An integer whose value is the width of the column for which you want to find properties. This argument is passed by reference.

Returns

Integer. Returns 1 if it succeeds and -1 if an error occurs.

Usage

Use label, alignment, and width to retrieve the properties for a specified column.

Examples

Example 1

This example uses the instance variable li_col to pass the column number to GetColumn and retrieve the properties for the column. The script uses SetColumn to change the column’s alignment:

string ls_label,ls_align

int li_width

alignment la_align


IF lv_list.View <> ListViewReport! THEN

    lv_list.View = ListViewReport!

END IF


IF li_col = 0 THEN

    MessageBox("Error!","Click on a Column bar.", &

      StopSign!)

ELSE

    lv_list.GetColumn(li_col, ls_label, la_align, &

      li_width)

    lv_list.SetColumn(li_col, ls_label, Right!, &

      li_width)

END IF

See also