WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

Enable

This method enables or disables the keyboard and touch screen input on a widget.

Ole declaration

VARIANT_BOOL EnableByName(LPCTSTR sObjectName, VARIANT_BOOL bEnable);

VARIANT_BOOL EnableById(SHORT usObjectId, VARIANT_BOOL bEnable);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
bEnable
Specifies whether a widget is enabled or disabled. If this parameter is TRUE the keyboard and touch screen input will be enabled, otherwise it will be disabled.
Return Value

On success, Enable returns TRUE, FALSE otherwise. 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");
oWidget.EnableById(iFieldId, False);	
Visual Basic 6 (Full Example: BasicPropertiesDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
'Enable and disables the widgets
Case "enableCheckBox"
	bEnabled = Not bEnabled
	wsWidget.EnableByName "topLine", bEnabled
	wsWidget.EnableByName "button", bEnabled
	wsWidget.EnableByName "label", bEnabled
	wsWidget.EnableByName "checkBox", bEnabled
	wsWidget.EnableByName "radioButton", bEnabled
	wsWidget.EnableByName "progBar", bEnabled
	wsWidget.EnableByName "field", bEnabled
	wsWidget.EnableByName "listBox", bEnabled
	wsWidget.EnableByName "comboBox", bEnabled
	wsWidget.EnableByName "bottomLine", bEnabled
...
See also

Show | EnableTabStop

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