Validate Input and Play Error Sound
Environment
Product Version | 2019.1.117 |
Product | RadMaskedEditBox for WinForms |
Description
An example demonstrating how the RadMaskedEditBox control can be customized to validate the user input and play sound if the input is not according to the applied mask.
Solution
The RadMaskedEditBox is working with a mask provider to validate the input. The mask provider inside the control is used internally and one cannot call its Validate method outside of the context of the control. A possible solution is to create a separate mask provider instance solely responsible for validating the input and playing the error beep sound. The actual validation can be performed in the KeyDown event of the control.
The same result can be achieved with the other mask providers as well.