WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

AddColumn

This method adds a new column on a WS_LIST_CTRL widget.

Ole declaration

VARIANT_BOOL AddColumnByName(LPCTSTR sObjectName, SHORT usColumnWidth, LPCTSTR sColumnText);

VARIANT_BOOL AddColumnById(SHORT usObjectId, SHORT usColumnWidth, LPCTSTR sColumnText);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usColumnWidth
The new column's width.
sColumnText
The text displayed by the column header.
Return Value

On success, AddColumn returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Remarks

The column's width it's measured in the same way that a widget's width: It depends on the current coordinates type of the parent form (See SetCoordType ).

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
short sListCtrlId= 4;
oWidget.CreateWidgetById((short)WSTFactoryConstants.WS_LIST_CTRL, sListCtrlId, "", 0,0, 50, 50, "");
oWidget.AddColumById(sListCtrlId, 40, "Product Id");
Visual Basic 6 (Full Example: ListCtrlDemoModule.bas)
Public wsWidget As New WStWidget
...
wsWidget.AddColumnByName "myListCtrl", 40, "Column1"
wsWidget.AddColumnByName "myListCtrl", 40, "Column2"
wsWidget.AddColumnByName "myListCtrl", 40, "Column3"
wsWidget.AddColumnByName "myListCtrl", 40, "Column4"
wsWidget.AddColumnByName "myListCtrl", 40, "Column5"
...
See also

ClearColumns | AddRow | ClearRows | SetRowText | SetRowIcon | DeleteRow | GetSelectedItem | ReadRowsFromFile | SetLoadMode

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference