WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

ClearOptions

Removes the options of a WS_MENU widget.

Ole declaration

VARIANT_BOOL ClearOptionsByName(LPCTSTR sObjectName);

VARIANT_BOOL ClearOptionsById(SHORT usObjectId);

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

On success, ClearOptions 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 iMenuId = 15;
oFactory .CreateWidgetById((short)WSTFactoryConstants.WS_MENU, iMenuId,"", 0,0, 50, 50, "");
oWidget.ChangeMenuTypeById(iMenuId, (short)WSTWidgetConstants.WS_COMBO_BOX_MENU_TYPE);
oWidget.AddOption(iMenuId, 0, "Show Menu");
oWidget.AddOption(iMenuId, 0, "Save File");
oWidget.AddOption(iMenuId, 0, "Close Application");
oWidget.ClearOptionsById(iMenuId);
Visual Basic 6 (Full Example: MenuDemoModule.bas.txt)
Public wsWidget As New WStWidget
...
Case "deleteOptionsBtn"
	wsWidget.ClearOptionsByName "listBoxMenu"
	wsWidget.ClearOptionsByName "buttonMenu"
	wsWidget.ClearOptionsByName "comboBoxMenu"
...
See also

AddOption | GetOption | GetSelectedItem | ChangeMenuType

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