Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a sheet with four rows. When text is typed in any cell, the text overflows into the adjacent cells as shown in the following figure.

When typing is finished and edit mode is off, the text that will fit is displayed only within the cell boundaries.

C++

// Display only 4 columns and rows
m_Spread1.VisibleRows(4);
m_Spread1.VisibleCols(4);
m_Spread1.AutoSize(TRUE);
// Put text in the first column
m_Spread1.Col(1);
m_Spread1.Row(1);
m_Spread1.Text("1st Quarter");
m_Spread1.Row(2);
m_Spread1.Text("2nd Quarter");
m_Spread1.Row(3);
m_Spread1.Text("3rd Quarter");
m_Spread1.Row(4);
m_Spread1.Text("4th Quarter");
m_Spread1.Col(2);
m_Spread1.Row(0);
m_Spread1.Text("Results");
m_Spread1.Col(1);
m_Spread1.Text("Quarter");
// enable overflow in edit mode
m_Spread1.AllowEditOverflow(TRUE);

Visual Basic

' Display only 4 columns and rows
fpSpread1.VisibleRows = 4
fpSpread1.VisibleCols = 4
fpSpread1.AutoSize = True
' Put text in the first column
fpSpread1.Col = 1
fpSpread1.Row = 1
fpSpread1.Text = "1st Quarter"
fpSpread1.Row = 2
fpSpread1.Text = "2nd Quarter"
fpSpread1.Row = 3
fpSpread1.Text = "3rd Quarter"
fpSpread1.Row = 4
fpSpread1.Text = "4th Quarter"
fpSpread1.Col = 2
fpSpread1.Row = 0
fpSpread1.Text = "Results"
fpSpread1.Col = 1
fpSpread1.Text = "Quarter"
' enable overflow in edit mode
fpSpread1.AllowEditOverflow = True

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