// Set the active cell fpSpread1.ActiveSheet.SetActiveCell(2, 2, false); ' Set the active cell FpSpread1.ActiveSheet.SetActiveCell(2, 2, False)
' Sets the background color and text color for the second cell, and sets the colors for locked cells, and sets the colors for selections. FpSpread1.ActiveSheet.Cells(0,1).Value = "This is default." FpSpread1.ActiveSheet.Cells(1,1).Value = "This is custom." FpSpread1.ActiveSheet.Cells(2,1).Value = "This is locked." FpSpread1.ActiveSheet.Cells(3,1).Value = "This is selected." FpSpread1.ActiveSheet.Cells(1,1].BackColor = Color.LimeGreen FpSpread1.ActiveSheet.Cells(1,1].ForeColor = Color.Yellow FpSpread1.ActiveSheet.Cells(2,1].Locked = True FpSpread1.ActiveSheet.Protect = True FpSpread1.ActiveSheet.LockBackColor = Color.Brown FpSpread1.ActiveSheet.LockForeColor = Color.Orange FpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors FpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range FpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell FpSpread1.ActiveSheet.SelectionBackColor = Color.Pink FpSpread1.ActiveSheet.SelectionForeColor = Color.Red
// Set the alignment of the first cell (A1) to be right-bottom aligned fpSpread1.Sheets[0].Cells[0,0].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right; fpSpread1.Sheets[0].Cells[0,0].VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Bottom; ' Set the alignment of the first cell (A1) to be right-bottom aligned FpSpread1.Sheets(0).Cells(0,0).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right FpSpread1.Sheets(0).Cells(0,0).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Bottom
// Create the bevel border FarPoint.Win.BevelBorder bevelBorder = new FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.Cyan, Color.DarkCyan); // Set cell B3 border to the bevel border fpSpread1.Sheets[0].Cells[4, 3].Border = bevelBorder; ' Create the bevel border Dim bevelBorder As New FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.Cyan, Color.DarkCyan) ' Set cell B3 border to the bevel border FpSpread1.Sheets(0).Cells(4, 3).Border = bevelBorder
// Create a new complex border side with two lines FarPoint.Win.ComplexBorderSide bottomBorder = new FarPoint.Win.ComplexBorderSide(true, Color.Black, 3, System.Drawing.Drawing2D.DashStyle.Solid, null, new Single[] {0f, 0.33f, 0.66f, 1f}); fpSpread1.Sheets[0].Cells[3, 7].Border = new FarPoint.Win.ComplexBorder(null, null, null, bottomBorder); ' Create a new complex border side with two lines Dim bottomBorder As New FarPoint.Win.ComplexBorderSide(Color.Black, 3, System.Drawing.Drawing2D.DashStyle.Solid, Nothing, New Single() {0, 0.33, 0.66, 1}) FpSpread1.Sheets(0).Cells(3, 7).Border = New FarPoint.Win.ComplexBorder(Nothing, Nothing, Nothing, bottomBorder)
// Span six cells fpSpread1.ActiveSheet.AddSpanCell(1, 1, 2, 3); ' Span six cells fpSpread1.ActiveSheet.AddSpanCell(1, 1, 2, 3)
// Set the row and column merge policies for all rows and all columns fpSpread1.Sheets[0].SetRowMerge(-1, FarPoint.Win.Spread.Model.MergePolicy.Always); fpSpread1.Sheets[0].SetColumnMerge(-1, FarPoint.Win.Spread.Model.MergePolicy.Always); ' Set the row and column merge policies for all rows and all columns FpSpread1.Sheets(0).SetRowMerge(-1,FarPoint.Win.Spread.Model.MergePolicy.Always) FpSpread1.Sheets(0).SetColumnMerge(-1,FarPoint.Win.Spread.Model.MergePolicy.Always)
// Set the control to allow cells to overflow but only up to the maximum of 130 pixels fpSpread1.AllowCellOverflow = true; fpSpread1.SetMaximumCellOverflowWidth(130); ' Set the control to allow cells to overflow but only up to the maximum of 130 pixels FpSpread1.AllowCellOverflow = True FpSpread1.SetMaximumCellOverflowWidth(130)