Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

A Border object represents a border around a cell or area of cells.

{signature}
{remarks}To set a border around a single cell, set the [Border.Color|Border.Color] and [Border.Style|Border.Style] of a {{Border}} object retrieved through the cell's [Style|Style]:
{code:csharp}
cellB2.Style.Border.Style = Border.LineStyle.Thick;
{code}
{code:csharp}
cellB2.Style.Border.Color = Palette.SystemColor.Blue;
{code}

You can also define part of a cell's border using [Border.Item(Border.Part)]:

{code
}
cellB2.Style.Border[Border.Part.Outline].Color = Palette.SystemColor.Blue;
{code}
To return a {{Border}} object for an [Area], use [Area.BorderAround
.
|Area.BorderAround].
{remarks}
{example}{code:csharp|title=C#}

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          Worksheet ws = wb[0];
          Area a = ws.CreateArea(4, 4, 15, 6);
          Border b = a.BorderAround;
        
{code}
{code:vb.net
|title=vb.net
}

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          Dim ws As Worksheet = wb(0)
          Dim a As Area = ws.CreateArea(4, 4, 15, 6)
          Dim b As Border = a.BorderAround
        
Signature
C#C#
Wiki Markup
{description}
{excerpt}A [Border|Border] object represents a border around a cell or area of cells. 
{excerpt}
{signature:C#}
[DefaultMember("Item")]
 public sealed class Border
Signature
{signature}{signature:vb.net
vb.net
}
<DefaultMember("Item")> _
	Public NotInheritable Class Border
Remarks

To set a border around a single cell, set the Border.Color and Border.Style of a Border object retrieved through the cell's Style:

Code Block
csharpcsharp
Code Block
csharpcsharp
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Properties

...

Name

...

Description

...

Color

...

{code}

{example}
{properties}
||Name||Description||
|[Color|Border.Color]|{excerpt-include:Border.Color

...

Style

|nopanel=true}|
|[Style|Border.Style]|{excerpt-include

...

:Border.Style

...

Indexers

...

Name

...

Description

|nopanel=true}|
{indexers}
||Name||Description||
|[Item(Border.Part)

...

|Border.Item(Border.Part)

...

]|{excerpt-include:Border.Item(Border.Part)

...

|nopanel

...

Classes

...

Name

...

Description

...

LineStyle

...

=true}|
{classes}
||Name||Description||
|[LineStyle|Border.LineStyle]|{excerpt-include:Border.LineStyle

...

Part

|nopanel=true}|
|[Part|Border.Part]|{excerpt-include

...

:Border.Part

...

|nopanel=true}|
{scrollbar}