Spread Windows Forms 8.0 Product Documentation > Developer's Guide > Customizing Interaction with Cell Types > Working with Editable Cell Types > Setting a GcTextBox Cell |
You can create a text cell that displays text. The GcTextBoxCellType cell is part of the GrapeCity.Win.PluginInputMan assembly.
You can specify automatic complete mode and a custom source with the AutoCompleteMode and AutoCompleteCustomSource properties. You can also specify maximum limits for the cell with the MaxLength property.
You can use the ShortcutKeys property to map keys to actions for the GcDateTime and GcTextBox cells. In edit mode, these shortcut keys have precedence over the Spread input maps. The cell uses the Spread input maps when not in edit mode.
The FormatString property allows you to specify specific characters that are allowed in the cell. The following Spread Designer table displays the available characters.
For a complete list of properties, see the GcTextBoxCellType class.
This example creates a GcTextBoxCellType cell.
C# |
Copy Code
|
---|---|
GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType inputcell1 = new GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType(); inputcell1.Multiline = true; inputcell1.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Cut; fpSpread1.Sheets[0].Cells[1, 1].CellType = inputcell1; |
VB |
Copy Code
|
---|---|
Dim inputcell1 As New GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType inputcell1.Multiline = True inputcell1.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Cut FpSpread1.Sheets(0).Cells(1, 1).CellType = inputcell1 |
Or right-click on the cell or cells and select Cell Type. From the list, select GcTextBox. In the CellType editor, set the properties you need. Click Apply.