Table of Contents

Property Border

Namespace
Terminal.Gui.ViewBase
Assembly
Terminal.Gui.dll

Border

Gets the Border adornment that draws the visual frame, title, and optional tab header between the Margin and Padding layers.

public Border Border { get; }

Property Value

Border

Remarks

The Border provides the space for a visual border (drawn using line-drawing glyphs) and the Title. When Settings includes Tab, the border renders a tab header on the side specified by TabSide.

The Border expands inward: if Border.Thickness.Top == 2, the border and title occupy the first two rows, reducing the Viewport.

The Border also provides the UI for mouse and keyboard arrangement of the View. See Arrangement and the Arrangement Deep Dive.

BorderStyle is a convenience helper that sets LineStyle and Thickness atomically. Use Border directly for advanced configuration (tab mode, gradient, custom thickness per side).

The adornments (Margin, Border, and Padding) are not part of the View's content and are not clipped by the View's Clip Area.

Changing the size of an adornment will change the size of Frame which will call SetNeedsLayout() to update the layout of the SuperView and its SubViews.

Simple border:
<pre><code class="lang-csharp">view.BorderStyle = LineStyle.Single;

// Result: // ┌┤Title├──┐ // │ │ // └─────────┘

Tab-style border:

<pre><code class="lang-csharp">view.BorderStyle = LineStyle.Rounded;

view.Border.Settings = BorderSettings.Tab | BorderSettings.Title; view.Border.TabSide = Side.Top; view.Border.Thickness = new Thickness (1, 3, 1, 1); // Result (focused): // ╭───╮ // │Tab│ // │ ╰───╮ // │content│ // ╰───────╯