Skip to content
Tyberious edited this page Sep 4, 2023 · 1 revision

Clock Control

The Clock control lets you display an asynchronous clock in your console window.

Properties

  • X and Y: Set the position of the clock.
  • BackgroundColor and ForegroundColor: Customize colors for the clock.
  • SeparatorBlink: Defines whether the separator characters [:] will blink every other tick
  • TwelveHour: Defines whether the clock will display in 12 or 24 hour format.

Methods

  • Start: Starts ticking the clock, will redraw an update every 1000 milliseconds.
  • Stop: Stops ticking the clock.
  • Draw: Paints the clock on the screen with assigned properties.

Example

Clock MainMenuClock = new Clock
{
    X = 5,
    Y = 10,
    BackgroundColor = ConsoleColor.DarkBlue,
    ForegroundColor = ConsoleColor.White,
    TwelveHour = false,
    SeparatorBlink = true
};
Clone this wiki locally