ComponentOne True DBInput Pro 8.0
Text Property (TDBText)

 

Text Property (TDBText)

Sets/returns the text contained in the control.

Syntax

TDBText.Text= string

Read/Write at run time and design time.

Remarks

The Text property allows you to read the actual string contained in the edit area. For example, although the control displays the password placeholder character specified with the PasswordChar property, the Text property will still return the exact text string the user typed or what was set from code.

The default setting for the Text property will be given default names such as TDBText1, TDBText2, and so forth when first created. This is the default property of the TDBText control.

You can use the Text property to set character codes such as vbCr (Chr(13)), vbLf (Chr(10)), vbCrLf (Chr(13)+Chr(10)), vbTab (Chr(9)) within the text string when the MultiLine property is set to True. For example:

With TDBText.Caption

.MultiLine = True

.Text = "Dear John," & vbCrLf & vbTab & "How are you?"

End With

Note that when applying the character codes in single line mode, the characters will be displayed as dots.

When working with Text, the text string passed in must exactly match the input mask specified in the Format property otherwise a trappable error will occur. For example:

TDBTime.Format = "A9"

TDBTime.Text = "96a1244h"

But if the AutoConvert property is set to True, all convertible characters will automatically converted accordingly to the input mask. For example:

TDBTime.Format = "A9"

TDBTime.Text = "96a1244h"

 In the example above, the lower case characters passed in will be automatically converted to upper case. The control text will be displayed as "96A1244H".

The Text setting for the control can contain large amounts of data, even amounts in excess of 64 kilobytes. However, the number of characters the control can hold is limited by the memory of the user's computer.

If you assign a text string that exceeds the length of the maximum characters to the Text property, the extra characters will be truncated.

The Text property will be automatically set to a zero-length string when modifying the Format property.

See Also

MultiLine Property (TDBText)

PasswordChar Property (TDBText)

MaxLength Property (TDBText)

Format Property (TDBText)

AutoConvert Property (TDBText)

 

 


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

Product Support Forum  |  Documentation Feedback