WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetBarPosition

Sets the bar's position on a WS_PROGRESS_BAR widget.

Ole declaration

VARIANT_BOOL SetBarPositionByName(LPCTSTR sObjectName, LONG lPos);

VARIANT_BOOL SetBarPositionById(SHORT usObjectId, LONG lPos);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
lPos
The new bar position, it must be between the upper and lower range set by SetRange.
Return Value

On success, SetBarPosition 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.SetBarPositionById(iProgressBarId, 50);
Visual Basic 6 (Full Example: ProgBarDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
Case "runButton"
	iNumberOfIterations = iMaxVal / iStepVal
	wsWidget.SetBarPositionByName "progBar", 0

	For i = 0 To iNumberOfIterations
		wsWidget.StepByName "progBar"
		wsForm.CommitChangesByName "progBarForm"
	Next i
...
See also

SetStep | Step | SetRange | SetBarColor

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