Xceed Workbooks for .NET v2.0 Documentation
Style Property (Border)
Example 


Xceed.Workbooks.NET Assembly > Xceed.Workbooks.NET Namespace > Border Class : Style Property
Gets or sets the style of the Border. The default value is None.
Syntax
'Declaration
 
Public Property Style As LineStyle
'Usage
 
Dim instance As Border
Dim value As LineStyle
 
instance.Style = value
 
value = instance.Style
public LineStyle Style {get; set;}
Remarks
If the Color property is not defined, Color will automatically be set to black.
Example
var workbook = Workbook.Create("test.xlsx" )

// Get the first worksheet. A workbook contains at least 1 worksheet.
var cellWorksheet = workbook.Worksheets[ 0 ];

// Set cell content and Border styles.
cellWorksheet.Cells[ "C5" ].Value = "Bottom";
cellWorksheet.Cells[ "C5" ].Style.Borders[ BorderType.Bottom ].Style = LineStyle.Double;
cellWorksheet.Cells[ "C5" ].Style.Borders[ BorderType.Bottom ].Color = Color.Red;

cellWorksheet.Cells[ "C8" ].Value = "Top";
cellWorksheet.Cells[ "C8" ].Style.Borders[ BorderType.Top ].Style = LineStyle.DashDot;

cellWorksheet.Cells[ "C11" ].Value = "Right";
cellWorksheet.Cells[ "C11" ].Style.Borders[ BorderType.Right ] = new Border() { Style = LineStyle.MediumDashed, Color = Color.Green };

// Save workbook to disk.
workbook.Save();
Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Border Class
Border Members