Skip to content
Tyberious edited this page Aug 31, 2023 · 2 revisions

Label Control

The Label control lets you display text in the console.

Properties

  • X and Y: Set the position of the label.
  • BackgroundColor and ForegroundColor: Customize colors for the label.
  • Caption: The text that will be displayed in the label.

Example

Label nameLabel = new Label
{
    X = 5,
    Y = 10,
    BackgroundColor = ConsoleColor.DarkBlue,
    ForegroundColor = ConsoleColor.White,
    Caption = "Welcome to SimpleConsole.Controls!"
};

Updating the Caption property will result in the label being redrawn to the console window.

Clone this wiki locally