|
|
WireLess Studio Widgets Developer's Guide |
|
This method changes the text displayed by a widget.
VARIANT_BOOL SetTextByName(LPCTSTR sObjectName, LPCTSTR sText);
VARIANT_BOOL SetTextById(SHORT usObjectId, LPCTSTR sText);
On success, SetText returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
Although this method has no effect on some widgets e.g.: WS_BITMAP, WS_LIST_CTRL, etc. The text is saved by the widget and can be retrieved later.
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
WStFactory oFactory = new WStFactory();
short iButtonId = 44;
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_BUTTON, sButtonId, "", 0,0, 50, 50, "");
string sMessage = string.Format("{0:00}",33);
oWidget.SetText(iButtonId, sMessage);
Public wsWidget As New WStWidget
...
'Shows initial state of the checkBoxes
sState = wsWidget.GetStateByName("checkBox")
sCurrentState = "CheckBox: " + sState
sState = wsWidget.GetStateByName("checkBox4")
sCurrentState = sCurrentState + " " + "CheckBox4: " + sState
wsWidget.SetTextByName "firstLineState", sCurrentState
...
GetText | SetFont | SetTextColor | SetBackgroundColor
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 |