This project has moved. For the latest updates, please go here.

Masked Text Box and "Regular" Text Box : differences

Jan 11, 2011 at 8:44 PM
Edited Jan 11, 2011 at 8:51 PM

Hi,

I've noted a few differences between the masked text box and the "regular" text box. I'm not sure if those are issues :

- The text property is still present, but seems to overlap with the value property for default value, and doesnt work with binding. Should be hidden ?

- The IsReadOnly property is not here : http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(SYSTEM.WINDOWS.CONTROLS.PRIMITIVES.TEXTBOXBASE.ISREADONLY);k(VS.XAMLEDITOR);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22)&rd=true . It may be possible to achieve the same behavior with another property ?

Thanks for any ideas about this differences, and let me know if I should insert them in the issue tracker :)

BTW great job on all those controls, they are really helpful !

Jan 11, 2011 at 8:51 PM

The Text property isn't used for data binding.  It is used to get the masked text from the MaskedTextBox.  You should only data bind to the Value property.  This is because the underlying value may be a different data type, or stored without the mask characters.

Use the IsEditable property instead of the IsReadOnly.  I will consider renaming it to IsReadOnly.

Jan 11, 2011 at 8:59 PM

Excellent ! I stayed away from the text property, and inverted my binding values for the isreadonly to make them iseditable, and it works like a charm. Thanks a lot :)

Jun 13, 2011 at 7:12 PM

The MaskedTextBox now derives from TextBox so you don't have to invert your bindings anymore.  Just use the IsReadOnly property.