WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetBarColor

This method changes the bar color of a WS_PROGRESS_BAR widget.

Ole declaration

VARIANT_BOOL SetBarColorByName(LPCTSTR sObjectName, SHORT usRed, SHORT usGreen, SHORT usBlue);

VARIANT_BOOL SetBarColorById(SHORT usObjectId, SHORT usRed, SHORT usGreen, SHORT usBlue);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
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, SetBarColor returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Remarks
Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
WStFactory oFactory = new WStFactory();
short iProgressBarId = 22;
oFactory .CreateWidgetById((short)WSTFactoryConstants.WS_PROGRESS_BAR, iProgressBarId, "", 0,0, 50, 50, "");
oWidget.SetBarColorById(iProgressBarId, 128, 33, 255);
Visual Basic 6 (Full Example: ProgBarDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
Case "barColorRedField"
	barColorRed = sEventValue
	wsWidget.SetBarColorByName "progBar", barColorRed, barColorGreen, barColorBlue
...
See also

SetBarPosition | SetStep | Step | SetRange

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