Spread 8.0 Documentation
Text Property
Support Options
ActiveX Reference > ActiveX Properties > Text Property

Glossary Item Box

Text Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Sets or returns the contents of the specified cell. This property is available at run time only.

Syntax

C++

CString CSpreadSheet::GetText( );
void CSpreadSheet::SetText(LPCTSTR value);

Visual Basic

[form.]fpSpread.Text[ = text$]

Remarks

The following table explains the data format to use when setting data using the Text property, and the format returned when returning data using the Text property. Values in quotation marks (" ") are string values.

Cell Type Sample Data Set or Return Data
Button True (Two-state) "1"
False (Two-state) "0"
Not set (Two-state; looks False) Empty string
Check Box True "1"
False "0"
Grayed "2"
Not set; looks False Empty string
Combo Box   Text string of selected item
Currency "$10,000.00" "$10,000.00"
Date "10/29/2001" "10/29/2001"
When setting, provide in format that matches the setting of the TypeDateFormat property. Use a separator where separators are displayed in the format.
Edit   Text string
If the TypeEditMultiLine property is set to True, a linefeed character (ASCII 10 or `\n' in C++) can be used to force a line break when setting text.
Number "10,000.00" "10,000.00" or "1E4"
Owner-Drawn not applicable
Percent "15%" "15%"
PIC "22-45-76" "22-45-76" or "22 45 76" where space is used instead of typing the placeholder character for setting data
Picture not applicable
Scientific "2.22E+05" "2.22E+05"
Static Text   Text string
If the TypeTextWordWrap property is set to True, a linefeed character (ASCII 10 or `\n' in C++) can be used to force a line break when setting text.
Time "11:25:03 pm" "11:25:03 pm"
When setting and using an a.m./p.m. indicator, include a space between the time value and the indicator, for example, "10:00:00 p.m."

This setting is applied to the current sheet setting unless you first set the Sheet property to specify the sheet for which you are setting the property. Set the Col and Row properties to specify a cell before using the Text property. If you set the Col or Row property to –1 to set data for multiple cells, the same data is placed in each cell. If you set the Col or Row property to –1 to return data from multiple cells, unless the cells were set with the Col or Row property set to –1, the property does not return a value.

Note: The Text property does not return the text in a column or row header cell unless the cell contains custom text. The property does not return the auto text in the header cells.

The Text property can be used to set or return data in cells, as can the Clip, ClipValue, and Value properties, and the GetFloat, GetInteger, GetText, SetFloat, SetInteger, and SetText methods. Use the Text property to set or return formatted data in cells. For more information about using these properties and methods, see Adding Data and Returning Data. For more information about formatted data, see Formatted and Unformatted Data.

Spread Designer

If you enter data when Learn Mode is on, the Text property is set in the generated code when appropriate. For more information on Learn Mode and viewing code generated by the Spread Designer, see Using Learn Mode in Spread Designer.

Data Type

String

See Also

Adding Data
Returning Data
Specifying Header Text
Customizing Headers for Bound Sheets
Creating and Customizing a Static Text Cell

CellType, Clip, ClipValue, Col, Row, Sheet, TypeDateFormat, TypeEditMultiLine, TypeTextWordWrap, Value properties

GetFloat, GetInteger, GetText, SetFloat, SetInteger, SetText methods

DLL Correspondence

SSGetData, SSSetData, SSSetDataRange functions

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.