Formatting data

Formatting data

When I set the FormatMask property for a data field object, the value of the field is formatted when a user enters data and tabs out of the field. How can I get formatting information to show up while the user is entering data in the field?

As you have seen, the FormatMask property is used to format the display of data, not the entry of data.

You could set the DefaultValue of the object to show the formatting information and then use the OnKey() method to process keystrokes and format the object’s value properly.

To see an example of the OnKey() method at work, check out the question on hiding the value of a field for the entry of a password. You might see something in version 2.0 of OPO that might address your particular problem, too.


Share the Post: