WireLess Studio Widgets Developer's Guide |
This method changes the position of a specific widget. The position is relative to the upper-left corner of the screen.
VARIANT_BOOL SetPositionByName(LPCTSTR sObjectName, SHORT usXCoord, SHORT usYCoord);
VARIANT_BOOL SetPositionById(SHORT usObjectId, SHORT usXCoord, SHORT usYCoord);
SetPosition returns TRUE if the position of the widget could be changed, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
The widget's position depends on the coordinates type used by parent form. (For more information see SetCoordType).
using WirelessStudioOleWidgets; WStWidget oWidget = new WStWidget(); WStFactory oFactory = new WStFactory(); short iBitmapId = 10; oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_BITMAP, iBitmapId , "", 0,0, 50, 50, ""); oWidget.SetPositionById(iBitmapId, 10, 50);
Public wsWidget As New WStWidget ... Public Sub ChangePosition(iXOffset As Integer, iYOffset As Integer) wsWidget.SetPositionByName "topLine", wsWidget.GetXCoordByName("topLine") + iXOffset, _ wsWidget.GetYCoordByName("topLine") + iYOffset wsWidget.SetPositionByName "button", wsWidget.GetXCoordByName("button") + iXOffset, _ wsWidget.GetYCoordByName("button") + iYOffset ... End Sub
GetXCoord | GetYCoord | SetSize | GetWidth | GetHeight
WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference
WireLess Studio by SofToGo S.A. | Visit our site www.softogo.com | Contact us help@softogo.com |