|
|
WireLess Studio Widgets Developer's Guide |
|
This method adds an removes input modes on a WS_FIELD widget.
The input modes regulates the characters typed on the widget, allowing the input of alphabetic characters or numbers separately.
VARIANT_BOOL ModifyInputModeByName(LPCTSTR sObjectName, LONG lRemove, LONG lAdd);
VARIANT_BOOL ModifyInputModeById(SHORT usObjectId, LONG lRemove, LONG lAdd);
On success, ModifyInputMode 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 input modes are:
The input 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"); /* Using the following combination of flags allows alphabetic characters only, which will be converted to uppercase*/ oWidget.ModifyInputModeById(iFieldId, (short)WSFieldConstants.WS_FIELD_IM_NUMERIC_ONLY, (short)WSFieldConstants.WS_FIELD_IM_ALPHA_ONLY | (short)WSFieldConstants.WS_FIELD_IM_TO_UPPER );
Public wsWidget As New WStWidget
...
Case "alphaKeysCheckBox"
If wsForm.GetLastEventIntValue() = WS_STATE_CHECKED Then
wsWidget.ModifyInputModeByName "field", 0, WS_FIELD_IM_ALPHA_ONLY
Else
wsWidget.ModifyInputModeByName "field", WS_FIELD_IM_ALPHA_ONLY, 0
End If
Case "numKeysCheckBox"
If wsForm.GetLastEventIntValue() = WS_STATE_CHECKED Then
wsWidget.ModifyInputModeByName "field", 0, WS_FIELD_IM_NUMERIC_ONLY
Else
wsWidget.ModifyInputModeByName "field", WS_FIELD_IM_NUMERIC_ONLY, 0
End If
...
ModifyDisplayMode | ModifyInputDevices | ModifyLenCtrlMode | 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 |