WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

AddRow

This method adds a new row on a WS_LIST_CTRL widget.

Ole declaration

VARIANT_BOOL AddRowByName(LPCTSTR sObjectName, SHORT usIconId);

VARIANT_BOOL AddRowById(SHORT usObjectId, SHORT usIconId);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usIconId
Specifies the id of an icon previously loaded with WStFactory::LoadExternalIcon.
Return Value

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

Remarks

If the icon id specified is nonzero, the 16 x 16 version of the icon will be loaded.

To use this method the current load mode must be WS_LIST_CTRL_LOAD_FROM_MEM (See SetLoadMode for more details).

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
short sListCtrlId= 4;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LIST_CTRL, sListCtrlId, "", 0,0, 50, 50, "");
oFactory.LoadExternalIcon(sIconId, WS_EXIT, @"\IconLib.dll");
oWidget.AddColumById(sListCtrlId, 40, "Product Id");
oWidget.AddRowById(sListCtrlId, sIconId);
Visual Basic 6 (Full Example: ListCtrlDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
'Adds 5 rows and sets their icons
wsWidget.AddRowByName "myListCtrl", 4
wsWidget.AddRowByName "myListCtrl", 5
wsWidget.AddRowByName "myListCtrl", 0
wsWidget.AddRowByName "myListCtrl", 0
wsWidget.AddRowByName "myListCtrl", 4
...
See also

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

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