Skip to content

HorizontalLine

Iuga Alexandru edited this page Sep 6, 2018 · 2 revisions

Description

Displays a horizontal line created by repeating a single character until the end of the row.

Features

  • Custom character - Any character can be used for filling the line.
  • Window width or Buffer width - The line can be draw to fill the width of the Console's Window or the full Console's Buffer.
  • Custom Width - Custom width can be specified.
  • Horizontal alignment - Left, Center or Right with respect to the Window width or the Console's Buffer width.
  • Foreground and Background colors - Any of the console colors can be used.
  • Margins and Paddings - All are fully functional.

Example

Static method (quick)

HorizontalLine.QuickDisplay();

Result:

Instance (more power)

HorizontalLine horizontalLine = new HorizontalLine
{
    Character = '*',
    ForegroundColor = ConsoleColor.Magenta,
    Margin = "0 1",
};
horizontalLine.Display();

Result:

Clone this wiki locally