Getting Started
You can change the properties of Formatted Text parts so that they
automatically validate the data that the user enters and format the data for
display. To do this, you modify the format property
associated with the Formatted Text part.
To have the data in the Enter SSN field appear in the format
of a standard U.S. social security number, you must change the
format type of the Formatted Text part to Social Security
Number.
- Open the SSN Formatted Text part's properties window.
- Select the Value field for the format property then
select
to open the Formats dialog. From the Data type drop-down
list, select String. This indicates that the type
of data is string.
- Now, to set the particular format for the string data, select
the Value field for the formatString property then
select
to open the Format string dialog. From the Predefined
formats , select Social security number (U.S.)
and then select OK to close the Format string window, select
OK to close the Formats dialog.
- To test how the formatted text will display, select
from the tool bar.
To have the data in the Price per share field appear as
currency, you must change the data type of the Formatted Text part to
Monetary Amount.
- Double-click on the Price per share Formatted Text part to open the
Properties window for the part.
- Select the Value field for the format property then
select
to open the Formats dialog. From the Data type drop-down
list, select Monetary. This indicates that the
type of data is monetary.
- For our purposes, we'll accept the default values for the monetary
type format. Select OK to close the Formats dialog.
- To test how the formatted text will display, select
from the tool bar.
For more information on validating and formatting data, see the
VisualAge Smalltalk User's Guide
.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]