We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Question on MaskedTextbox control

George Shepherd's Windows Forms FAQ 27.1 works fine for TextBox controls. I tried the same with a MaskedTextBox control. [C#] public class MyTextBox : MaskedTextBox { protected override void OnKeyPress(KeyPressEventArgs e) { if(e.KeyChar == (char) 13) e.Handled = true; else base.OnKeyPress (e); } } The beep is elimiated however the Mask Property behaves erratically. Does anyone know of an explanation for this?


Loader.
Live Chat Icon For mobile
Up arrow icon