Spread Windows Forms 8.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 |
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.
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 |