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
- Create a regular expression cell.
- Set the ShrinkToFit property.
- Set the CellType property.
- 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
- Select the cell or cells in the work area.
- 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.
- From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.