Table of Contents

Method Center

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Center()

Creates a Pos object that can be used to center the View.

public static Pos Center()

Returns

Pos

The center Pos.

Examples

This creates a TextView centered horizontally, is 50% of the way down, is 30% the height, and is 80% the width of the View it added to.

var textView = new TextView () {
   X = Pos.Center (),
   Y = Pos.Percent (50),
   Width = Dim.Percent (80),
   Height = Dim.Percent (30),
};