WireLess Studio Widgets Developer's Guide |
Call this method to retrieve a widget that has the "tab stop" property and follows a specific widget.
SHORT GetNextWidgetById(SHORT usFormId, SHORT usObjectId);
BSTR GetNextWidgetByName(LPCTSTR sFormName, LPCTSTR sObjectName);
On success, GetNextWidget returns the name or the id of the next widget with tab stop property enabled (depending on which version of the method is used). On error, GetNextWidget returns an empty string or zero. To get extended information, call WStError::GetLastErrorCode.
The default order is given by the way in which the widgets are attached to the form.
Only the widgets that support the EnableTabStop method can be enumerated using this method.
using WirelessStudioOleWidgets; WStFactory oFactory = new WStFactory(); WStForm oForm = new WStForm (); short formId = 10; oFactory.CreateFormById(formId); oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_BUTTON, 10 , "", 15, 15, 30, 30, "Button Test 1"); oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_BUTTON, 11 , "", 15, 45, 30, 30, "Button Test 2"); oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_BUTTON, 12 , "", 15, 75, 30, 30, "Button Test 3"); oForm.AddObjectBydId(formId, 10); oForm.AddObjectBydId(formId, 11); oForm.AddObjectBydId(formId, 12); oForm.ShowById(formId, true, true); short nextObjectId = oForm.GetNextWidgetById(formId, 10); if(nextObjectId != 0) { oForm.SetFocusById(nextObjectId); }
Public wsForm As New WStForm ... If wsForm.GetLastEventType() = WS_EVENT_TEXT_INPUT Then sNextWidget = wsForm.GetNextWidgetByName("popupMsgForm", sObjectName) If sNextWidget <> "" Then wsForm.SetFocusByName "popupMsgForm", sNextWidget End If End If ...
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 |