Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
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:vb.net}
<DefaultMember("Item")> _
	Public NotInheritable Class Border
{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
        {code}

{example}
{properties}
||Name||Description||
|[Color|Border.Color]|{excerpt-include:Border.Color|nopanel=true}|
|[Style|Border.Style]|{excerpt-include:Border.Style|nopanel=true}|
{indexers}
||Name||Description||
|[Item(Border.Part)|Border.Item(Border.Part)]|{excerpt-include:Border.Item(Border.Part)|nopanel=true}|
{classes}
||Name||Description||
|[LineStyle|Border.LineStyle]|{excerpt-include:Border.LineStyle|nopanel=true}|
|[Part|Border.Part]|{excerpt-include:Border.Part|nopanel=true}|
{scrollbar}