I am working on creating a class to support a console app I am developing, and I would like to create a method within to change both the background and foreground color. Is there a way to set a ConsoleColor value (which I believe is an enum) to another variable so this can easily be changed by the user at runtime? For instance, I am hoping for something like the following.
Public class ConsoleOutput
{
private var consoleBackground = ConsoleColor.White;
private var consoleForeground = ConsoleColor.Black;
Public ConsoleOutput
{
Console.BackgroundColor = consoleBackground
Console.ForegroundColor = consoleForeground
}
}
This, however, did not work.
