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

maskeditbox in readonly not working.....

The user is able to delete the values shown in a read only maskedit box....I don''t think this is the right behavior. I tried setting the readonly flag during runtime, but I get the same results. I could use the Enable property, but this doesn''t allow me to change the color of the font. Javier

1 Reply

AD Administrator Syncfusion Team September 8, 2004 12:30 AM UTC

Hi Javier, Thanks for bringing this to our attention. IU have notified the developmentteam in this regard, and will try our very best to resolve this issue at the earliest. For now, you could derive from the MaskedEditBox control and override its ProcessCmdKey method as shown in the code snippet below : public class CustomMaskedEditBox : MaskedEditBox { public CustomMaskedEditBox() : base() {} protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (this.ReadOnly == true) { if (keyData == Keys.Delete) { //do nothing return true; } else return false; } else return base.ProcessCmdKey (ref msg, keyData); } } The complete sample illustrating this is attached here. Please refer to it and let me know if this works for you. We appreciate your feedback, and thanks for choosing Syncfusion. Regards, Guru Patwal Syncfusion, Inc.

Live Chat Icon For mobile
Up arrow icon