WireLess Studio Widgets Developer's Guide |
This method changes current menu type on a WS_MENU widget.
VARIANT_BOOL ChangeMenuTypeByName(LPCTSTR sObjectName, SHORT usType);
VARIANT_BOOL ChangeMenuTypeById(SHORT usObjectId, SHORT usType);
On success, ChangeMenuType returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
The default menu type is WS_BUTTON_MENU_TYPE.
Changes on the menu type are effective only before the serialization of the parent form, once the form is transferred to the mobile unit the menu type can't be modified. But, If the menu is attached to more than one form, it's type may be different on each form.
The menu types can be found on the WSTWidgetConstants enumeration.
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");
Public wsWidget As New WStWidget Public wsFactory As New WStFactory ... wsWidget.ChangeMenuTypeByName "listBoxMenu", WS_LIST_BOX_MENU_TYPE wsWidget.ChangeMenuTypeByName "comboBoxMenu", WS_COMBO_BOX_MENU_TYPE ...
ClearOptions | AddOption | GetOption | GetSelectedItem
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 |