Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates an edit cell that allows multiple lines of data and adjusts the cell height to display all the text.

C++

float cellheight;
// Specify a cell
m_Spread.SetCol(2);
m_Spread.SetRow(3);
// Define cell type as edit
m_Spread.SetCellType(CellTypeEdit);
// Display multiple lines of data
m_Spread.SetTypeEditMultiLine(TRUE);
// Provide text for the cell
m_Spread.SetText("Holly grows as small bushes and as large trees.");
// Return the value of the selected cell
cellheight = m_Spread.GetMaxTextCellHeight();
// Set the height of the selected row to the value of
// the MaxTextCellHeight property
m_Spread.SetRowHeight(3,cellheight);

Visual Basic

Dim cellheight As Long
' Specify a cell
fpSpread1.Col = 2
fpSpread1.Row = 3
' Define cell type as edit
fpSpread1.CellType = CellTypeEdit
' Display multiple lines of data
fpSpread1.TypeEditMultiLine = True
' Provide text for the cell
fpSpread1.Text = "Holly grows as small bushes and as large trees."

' Return the value of the selected cell
cellheight = fpSpread1.MaxTextCellHeight
' Set the height of the selected row to the value of the MaxTextCellHeight property
fpSpread1.RowHeight(3) = cellheight

Copyright © GrapeCity, inc. All rights reserved.