WireLess Studio Widgets Developer's Guide |
Call this method to change the dimensions of a specific widget.
VARIANT_BOOL SetSizeByName(LPCTSTR sObjectName, SHORT usWidth, SHORT usHeight);
VARIANT_BOOL SetSizeById(SHORT usObjectId, SHORT usWidth, SHORT usHeight);
On success, SetSize returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
The widget's size depends on the coordinates type used by parent form. (For more information see WStForm::SetCoordType).
using WirelessStudioOleWidgets; WStWidget oWidget = new WStWidget(); WStFactory oFactory = new WStFactory(); short iFieldId = 10; oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_FIELD, iFieldId, "", 0,0, 50, 50, ""); oWidget.SetSizeById(iFieldId, 30, 30);
Public wsWidget As New WStWidget ... Public Sub ChangeSize(iSelectedOption As Integer) Dim iWidth As Integer Dim iHeight As Integer Select Case iSelectedOption Case 0 iWidth = 30 iHeight = 5 Case 1 iWidth = 42 iHeight = 12 Case 2 iWidth = 15 iHeight = 12 Case -1 iWidth = 42 iHeight = 12 End Select wsWidget.SetSizeByName "button", iWidth, iHeight wsWidget.SetSizeByName "label", iWidth, iHeight wsWidget.SetSizeByName "checkBox", iWidth, iHeight wsWidget.SetSizeByName "radioButton", iWidth, iHeight wsWidget.SetSizeByName "progBar", iWidth, iHeight wsWidget.SetSizeByName "field", iWidth, iHeight wsWidget.SetSizeByName "listBox", iWidth, iHeight wsWidget.SetSizeByName "comboBox", iWidth, iHeight + 2 End Sub
GetWidth | GetHeight | SetPosition | GetXCoord | GetYCoord
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 |