"namedColumnWidth"

Changes the width of a named column. The width of the column is defined in pixels.

Synopsis

shape.namedColumnWidth(string columnName, int pixelWidth);

Parameters

Parameter Description
shape Name of the object
columnName Name of the column
pixelWidth Width of the column

Description

This function allows changing the number of pixels for the width of a named column.

Example

The example changes the width of the selected column of a table. The columns are selected from a combo box (columnInd) on the basis of an index number (index number in the table). The pixel width is also chosen from a combo box (columnWid). In order to run the code, you need "Table1" as well as the combo boxes "columnInd"; and "columnWid";. The combo box "columnInd"; contains the index numbers of the table columns and the combo box "columnWid"; contains the available pixel widths.

main()
{
  int index;
  int pixelWidth;
  string columnName, sindex,swidth;
  sindex = columnInd.text; // Index number from the combo box
  index = sindex; //Set the index number
  swidth = columnWid.text; //Width from the combo box
  pixelWidth = swidth; //Set the width
  columnName = Table1.columnName(index);//Set the column of the table
  Table1.namedColumnWidth(columnName,pixelWidth);//Set the selected width 
  //for the selected column 
  DebugN(name," ",pixelWidth);
}

Assignment

Table