Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example sets a mask cell, centers the data, and sets the column width for the column containing the cell. The following figure shows the cell when it is in edit mode.

C++

// Specify a cell
m_Spread.SetCol(2);
m_Spread.SetRow(3);
// Define cell type as PIC
m_Spread.SetCellType(CellTypePic);
// Set the characters to center
m_Spread.SetTypeHAlign(TypeHAlignCenter);
// Define the mask
m_Spread.SetTypePicMask("(999) 999-9999");
// Define the default text
m_Spread.SetTypePicDefaultText("(123) 555-0123");
// Set column width of specified column
m_Spread.SetColWidth(2,12);

Visual Basic

' Specify a cell
fpSpread1.Col = 2
fpSpread1.Row = 3
' Define cell type as PIC
fpSpread1.CellType = CellTypePic
' Set the characters to center
fpSpread1.TypeHAlign = TypeHAlignCenter
' Define the mask
fpSpread1.TypePicMask = "(999) 999-9999"
' Define the default text
fpSpread1.TypePicDefaultText = "(123) 555-0123"
' Set column width of specified column
fpSpread1.ColWidth(2) = 12

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