WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

GetXCoord

Returns the position of the left side of the widget.

Ole declaration

SHORT GetXCoordByName(LPCTSTR sObjectName);

SHORT GetXCoordById(SHORT usObjectId);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
Return Value

On success, GetXCoord returns the current position of the left side of the widget. On error GetXCoord returns 32767. To get extended information, call WStError::GetLastErrorCode.

Remarks
Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
WStFactory oFactory = new WStFactory();
short iFieldId = 33;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_FIELD, iFieldId, "", 0,0, 50, 50, "123");
short x = oWidget.GetXCoordById(iFieldId);
Visual Basic 6 (Full Example: FieldDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
wsWidget.SetPositionByName "topLine", wsWidget.GetXCoordByName("topLine") + iXOffset, _
	wsWidget.GetYCoordByName("topLine") + iYOffset
wsWidget.SetPositionByName "button", wsWidget.GetXCoordByName("button") + iXOffset, _
	wsWidget.GetYCoordByName("button") + iYOffset
...
See also

GetYCoord | GetWidth | GetHeight | SetPosition | SetSize | GetText

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