WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

GetWidth

Returns the width of a widget.

Ole declaration

SHORT GetWidthByName(LPCTSTR sObjectName);

SHORT GetWidthById(SHORT usObjectId);

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

On success, GetWidth returns the width of a widget. On error GetWidth 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 width = oWidget.GetWidthById(iFieldId);
Visual Basic 6 (Full Example: BasicPropertiesDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
If wsWidget.GetWidthByName("button") = iWidth And _
	wsWidget.GetHeightByName("button") = iHeight Then
	Exit Sub
End If
...
See also

GetXCoord | GetYCoord | GetHeight | SetPosition | SetSize | GetText

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