WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

GetText

Returns the text displayed by a widget.

Ole declaration

BSTR GetTextByName(LPCTSTR sObjectName);

BSTR GetTextById(SHORT usObjectId);

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

On success, GetText returns the text displayed by the target widget, otherwise returns an empty string. 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");
string sText = oWidget.GetTextByid(iFieldId);
Visual Basic 6 (Full Example: BasicPropertiesDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
Select Case sObjectName
	Case "field"
		wsWidget.SetTextByName "EventResult", "New input: " + wsWidget.GetTextByName("field")
		wsWidget.SetTextByName "field", ""
...
See also

SetText | GetXCoord | GetWidth | GetHeight | SetPosition | SetSize

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