WireLess Studio Widgets Developer's Guide |
This method adds an removes length control modes on a WS_FIELD widget.
Along with SetMaxLength, the length control modes allow to regulate the length of the text processed when the ENTER key is pressed on a WS_FIELD widget.
VARIANT_BOOL ModifyLenCtrlModeByName(LPCTSTR sObjectName, LONG lRemove, LONG lAdd);
VARIANT_BOOL ModifyLenCtrlModeById(SHORT usObjectId, LONG lRemove, LONG lAdd);
On success, ModifyLenCtrlMode returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
Modes to be added or removed can be combined by using the bitwise OR ( | ) operator.
The available length control modes are:
If the WS_FIELD_LC_FORCE_ENTRY mode is set, the modes WS_FIELD_LC_NO_RETURN_ON_BKSP and WS_FIELD_LC_NO_CR_IF_EMPTY are not necessary.
WS_FIELD_LC_NO_CR_IF_EMPTY is set by default.
The length control modes can be found on the WSFieldConstants enumeration.
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.ModifyLenCtrlModeById(iFieldId, 0, (short)WSFieldConstants.WS_FIELD_LC_FORCE_ENTRY);
Public wsWidget As New WStWidget ... Case "forceEntryCheckBox" If wsForm.GetLastEventIntValue() = WS_STATE_CHECKED Then wsWidget.ModifyLenCtrlModeByName "field", 0, WS_FIELD_LC_FORCE_ENTRY Else wsWidget.ModifyLenCtrlModeByName "field", WS_FIELD_LC_FORCE_ENTRY, 0 End If ...
ModifyInputMode | ModifyDisplayMode | ModifyInputDevices | SetKeyboardMode | SetScannerConfigFile | SetMaxLength | GetLastInputType | GetLastBarcodeType
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 |