Spread Windows Forms 7.0 Product Documentation
Resizing the Data to Fit the Cell
See Also Support Options
Spread Windows Forms 7.0 Product Documentation > Developer's Guide > Customizing Row, Column, and Cell Appearance > Customizing the Appearance of a Cell > Resizing the Data to Fit the Cell

Glossary Item Box

You can display all the text in the cell with the shrink to fit option. The font size is reduced if the text is too long for the visible area of the cell.

This property is available for the currency, datetime, mask, number, percent, regular expression, text, or general cell.

The following image shows the difference between a cell with the ShrinkToFit property set to true and a cell with the property set to false.

Using Code

  1. Create a regular expression cell.
  2. Set the ShrinkToFit property.
  3. Set the CellType property.
  4. Type a valid expression such as 11240082777 for the regular expression cell.

Example

This example reduces the font size so the text is displayed in the cell.

C# Copy Code
FarPoint.Win.Spread.CellType.RegularExpressionCellType testcell = new FarPoint.Win.Spread.CellType.RegularExpressionCellType();
testcell.ShrinkToFit = true;
testcell.RegularExpression = "^\\d{11}$";
fpSpread1.Sheets[0].Cells[0, 0].CellType = testcell;
VB Copy Code
Dim testcell As New FarPoint.Win.Spread.CellType.RegularExpressionCellType()
testcell.ShrinkToFit = True
testcell.RegularExpression = "^\d{11}$"
FpSpread1.Sheets(0).Cells(0, 0).CellType = testcell

Using the Spread Designer

  1. Select the cell or cells in the work area.
  2. In the property list, in the Misc category, select CellType. From the drop-down list, choose the cell type. Now expand the CellType property and various properties are available that are specific to this cell type. Select and set those properties as needed.
  3. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.

See Also

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