Spread Windows Forms 8.0 Product Documentation
Creating a Complex Border with Multiple Lines

You can create a border of a cell with multiple lines using the complex border.

Using Code

Use the CompoundArray property of the ComplexBorderSide class to create multiple-line borders for a cell.

Examples

Example 1. This example code creates a ComplexBorderSide that has two underlines (two lines with a blank space in between) each taking a third of the width of the pen.

Compound Array Diagram for Two Lines

C#
Copy Code
// 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);
VB
Copy Code
' 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)

Example 2. This example code creates a ComplexBorderSide that has three lines with varying amounts of thickness and with some blank space on either edge of the pen.

Compound Array Diagram for Three Lines

C#
Copy Code
// Create a new complex border side with three lines.
FarPoint.Win.ComplexBorderSide bottomborder = new FarPoint.Win.ComplexBorderSide(true, Color.Black, 3, System.Drawing.Drawing2D.DashStyle.Solid, null, new Single[] {0.1f, 0.2f, 0.3f, 0.6f, 0.7f, 0.9f});
fpSpread1.Sheets[0].Cells[3, 7].Border = new FarPoint.Win.ComplexBorder(null, null, null, bottomborder);
VB
Copy Code
' Create a new complex border side with three lines.
Dim bottomborder As New FarPoint.Win.ComplexBorderSide(True, Color.Black, 3, System.Drawing.Drawing2D.DashStyle.Solid, Nothing, New Single() {0.1, 0.2, 0.3, 0.6, 0.7, 0.9})
FpSpread1.Sheets(0).Cells(3, 7).Border = New FarPoint.Win.ComplexBorder(Nothing, Nothing, Nothing, bottomborder)

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options | Documentation Feedback