ComponentOne True DBInput Pro 8.0
Text Property (TDBNumber)

 

Text Property (TDBNumber)

The Text property allows you to return or set an exact matching numeric value in text format including all literals specified with the Format property.

Syntax

TDBNumber.Text= string

Read/Write at run time and design time.

Remarks

In the examples below, the Value property will return a 0. If the Value property equals Null, the Text property will return a "Null" text string.

TDBNumber.Format = "###,###.##;(###,###.##);Zero;Null"

TDBNumber.Text = "Zero"

The Text property also can be influenced by the ClearAction property when setting a zero-length string, without the Zero and the Null format patterns specified. For example:

TDBNumber.Format = "###,###.##;(###,###.##)"

TDBNumber.ClearAction = dbiNull

TDBNumber.Text = ""

In the example above, the Value property will return Null. If the ClearAction property is set to 0-dbiZero, the Value property will return a 0. However, there may be cases when the control can distinguish between zero and Null without the format patterns specified. For example:

TDBNumber.Format = "###,##0.00;(###,##0.00)"

TDBNumber.Text = ""

In the example above, the Value property will return Null, since the Zero format is referenced by the input mask. In this case, the ClearAction property will not take any effect. Note that you must set "0.00" to the Text property in order to change the underlying value to zero. A text string "0" will cause an invalid value error, since it does not match the current format pattern.

When modifying numeric values by changing the Value or the Text properties, which are not within the proper range, this will cause an invalid value range error to occur without any events firing. If an invalid value is set into these properties, an invalid value error will occur.

When the Text property is changed, the changes will also be reflected in the Value property.

The Text property differs from the DisplayText property; the Text property returns a formatted string based on the Format property while the DisplayText property returns a formatted string based on the DisplayFormat property.

If the format set to the Format property and the format set to the DisplayFormat property are equal, the return text of the Text and DisplayText properties will also be the same.

See Also

Value Property (TDBNumber)

Format Property (TDBNumber)

DisplayFormat Property (TDBNumber)

DisplayText Property (TDBNumber)

ClearAction Property (TDBNumber)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback