WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetRange

Sets the limits of a WS_PROGRESS_BAR widget.

Ole declaration

VARIANT_BOOL SetRangeByName(LPCTSTR sObjectName, LONG lMinValue, LONG lMaxValue);

VARIANT_BOOL SetRangeById(SHORT usObjectId, LONG lMinValue, LONG lMaxValue);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
lMinValue
Specifies the lower limit of the range (default is zero).
lMaxValue
Specifies the upper limit of the range (default is 100).
Return Value

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

Remarks

Negative values are allowed.

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.SetRangeById(iProgressBarId , -10, 35);
Visual Basic 6 (Full Example: ProgBarDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
'Updates the progress bar max value
Case "progBarMaxValMenu"
	iMaxVal = Val(wsWidget.GetOptionByName("progBarMaxValMenu", iIntValue))
	wsWidget.SetRangeByName "progBar", 0, iMaxVal
...
See also

Step | SetStep | SetBarColor | SetBarPosition

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