WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetRowBackgroundColor

Sets the background color of a specific item on a WS_LIST_CTRL widget.

Ole declaration

VARIANT_BOOL SetRowBackgroundColorByName(LPCTSTR sObjectName, SHORT usRowIndex, SHORT usRed, SHORT usGreen, SHORT usBlue);

VARIANT_BOOL SetRowBackgroundColorById(SHORT usObjectId, SHORT usRowIndex, SHORT usRed, SHORT usGreen, SHORT usBlue);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usRowIndex
The item's row index.
usRed
Specifies the intensity of the red color.
usGreen
Specifies the intensity of the green color.
usBlue
Specifies the intensity of the blue color.
Return Value

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

Remarks
Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
short sListCtrlId= 4;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LIST_CTRL, sListCtrlId, "", 0,0, 50, 50, "");
oWidget.AddColumById(sListCtrlId, 40, "Product Id");
oWidget.AddRowById(sListCtrlId, 0);
oWidget.SetRowTextById(sListCtrlId, 0, 0, "33413");
oWidget.SetRowBackgroundColorById(sListCtrlId, 0, 255, 0, 0);
Visual Basic 6 (Full Example: ListCtrlDemoModule.bas.txt)
iRows = wsWidget.GetItemCountByName("listCtrl")

For i = 0 To iRows - 1
	If i Mod 2 = 0 Then
		wsWidget.SetRowBackgroundColorByName "listCtrl", i, iRed, iGreen, iBlue
	End If
Next i
See also

SetRowText | SetRowIcon

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