WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

GetYCoord

Returns the position of the top of the widget.

Ole declaration

SHORT GetYCoordByName(LPCTSTR sObjectName);

SHORT GetYCoordById(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 top 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 y = oWidget.GetYCoordById(iFieldId);
Visual Basic 6 (Full Example: BasicPropertiesDemoModule.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

GetXCoord | GetWidth | GetHeight | SetPosition | SetSize | GetText

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