// Create a currency cell FarPoint.Win.Spread.CellType.CurrencyCellType currcell = new FarPoint.Win.Spread.CellType.CurrencyCellType(); currcell.CurrencySymbol = "US$"; currcell.DecimalSeparator = ":"; currcell.DecimalPlaces = 8; currcell.MinimumValue = 1; currcell.MaximumValue = 10; fpSpread1.ActiveSheet.Cells[1,1].CellType = currcell; ' Create a currency cell Dim currcell As New FarPoint.Win.Spread.CellType.CurrencyCellType() currcell.CurrencySymbol = "US$" currcell.DecimalSeparator = ":" currcell.DecimalPlaces = 8 currcell.MinimumValue = 1 currcell.MaximumValue = 10 FpSpread1.ActiveSheet.Cells(1,1).CellType = currcell
// Create a dateTime cell FarPoint.Win.Spread.CellType.DateTimeCellType datecell = new FarPoint.Win.Spread.CellType.DateTimeCellType(); fpSpread1.ActiveSheet.Cells[1, 1].CellType = datecell; ' Create a dateTime cell Dim datecell As New FarPoint.Win.Spread.CellType.DateTimeCellType() FpSpread1.ActiveSheet.Cells(1, 1).CellType = datecell
// Create a general cell FarPoint.Win.Spread.CellType.GeneralCellType gnrlcell = new FarPoint.Win.Spread.CellType.GeneralCellType(); fpSpread1.ActiveSheet.Cells[1, 1].CellType = gnrlcell; ' Create a general cell Dim gnrlcell As New FarPoint.Win.Spread.CellType.GeneralCellType() FpSpread1.ActiveSheet.Cells(1, 1).CellType = gnrlcell
// Create a mask cell for a US phone number FarPoint.Win.Spread.CellType.MaskCellType maskcell = new FarPoint.Win.Spread.CellType.MaskCellType(); maskcell.Mask = "(###) ###-####"; maskcell.MaskChar = Convert.ToChar("_"); fpSpread1.ActiveSheet.Cells[1, 1].CellType = maskcell; ' Create a mask cell for a US phone number Dim maskcell As New FarPoint.Win.Spread.CellType.MaskCellType() maskcell.Mask = "(###) ###-####" maskcell.MaskChar = "_" FpSpread1.ActiveSheet.Cells(1, 1).CellType = maskcell
// Create a number cell and set a few options FarPoint.Win.Spread.CellType.NumberCellType nmbrcell = new FarPoint.Win.Spread.CellType.NumberCellType(); nmbrcell.DecimalSeparator = ","; nmbrcell.DecimalPlaces = 5; nmbrcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional; nmbrcell.MaximumValue = 500.000; nmbrcell.MinimumValue = -10.000; fpSpread1.ActiveSheet.Cells[1, 1].CellType = nmbrcell; ' Create a number cell and set a few options Dim nmbrcell As New FarPoint.Win.Spread.CellType.NumberCellType() nmbrcell.DecimalSeparator = "," nmbrcell.DecimalPlaces = 5 nmbrcell.LeadingZero = FarPoint.Win.Spread.CellType.LeadingZero.UseRegional nmbrcell.MaximumValue = 500.000 nmbrcell.MinimumValue = -10.000 FpSpread1.ActiveSheet.Cells(1, 1).CellType = nmbrcell
// Create a percent cell and set a few options FarPoint.Win.Spread.CellType.PercentCellType prctcell = new FarPoint.Win.Spread.CellType.PercentCellType(); prctcell.PercentSign = "%"; prctcell.PositiveFormat = FarPoint.Win.Spread.CellType.PercentPositiveFormat.PercentSignBeforeWithSpace; fpSpread1.ActiveSheet.Cells[1, 1].CellType = prctcell; ' Create a percent cell and set a few options Dim prctcell As New FarPoint.Win.Spread.CellType.PercentCellType() prctcell.PercentSign = "%" prctcell.PercentPositiveFormat = FarPoint.Win.Spread.CellType.PercentPositiveFormat.PercentSignBeforeWithSpace FpSpread1.ActiveSheet.Cells(1, 1).CellType = prctcell
// Create a regular expression cell FarPoint.Win.Spread.CellType.RegularExpressionCellType regexcell = new FarPoint.Win.Spread.CellType.RegularExpressionCellType() regexcell.RegularExpression = "[0-9]{3}-[0-9]{2}-[0-9]{4}"; fpSpread1.ActiveSheet.Cells[0, 0].CellType = regexcell; ' Create a regular expression cell Dim regexcell As New FarPoint.Win.Spread.CellType.RegularExpressionCellType() regexcell.RegularExpression = "[0-9]{3}-[0-9]{2}-[0-9]{4}" FpSpread1.ActiveSheet.Cells(0, 0).CellType = regexcell
// Create a text cell and set some options FarPoint.Win.Spread.CellType.TextCellType tcell = new FarPoint.Win.Spread.CellType.TextCellType() tcell.CharacterCasing = CharacterCasing.Upper; tcell.CharacterSet = FarPoint.Win.Spread.CellType.CharacterSet.Ascii; tcell.MaxLength = 30; tcell.Multiline = true; fpSpread1.ActiveSheet.Cells[0, 0].CellType = tcell; ' Create a text cell and set some options Dim tcell As New FarPoint.Win.Spread.CellType.TextCellType() tcell.CharacterCasing = CharacterCasing.Upper tcell.CharacterSet = FarPoint.Win.Spread.CellType.CharacterSet.Ascii tcell.MaxLength = 40 tcell.Multiline = True FpSpread1.ActiveSheet.Cells(0, 0).CellType = tcell