WireLess Studio Widgets Developer's Guide |
Sets maximum number of characters that can be typed on a WS_FIELD widget.
VARIANT_BOOL SetMaxLengthByName(LPCTSTR sObjectName, SHORT usMaxLength);
VARIANT_BOOL SetMaxLengthById(SHORT usObjectId, SHORT usMaxLength);
On success, SetMaxLength returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
The limit set by this method doesn't apply to the scanner input.
Once the maximum number of characters is reached and the length control mode WS_FIELD_LC_NO_RETURN_ON_FILL is not set (using ModifyLenCtrlMode) the input is processed and sent to the server. The widget triggers an event and GetEvent returns.
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.SetMaxLengthById(iFieldId, 3);
Public wsWidget As New WStWidget ... Case "maxLengthField" iMaxLength = wsForm.GetLastEventStrValue() wsWidget.SetMaxLengthByName "field", iMaxLength ...
ModifyInputMode | ModifyDisplayMode | ModifyInputDevices | ModifyLenCtrlMode | SetScannerConfigFile | SetKeyboardMode | 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 |