Console::ResetColor Method ()
Sets the foreground and background console colors to their defaults.
Assembly: mscorlib (in mscorlib.dll)
| Exception | Condition |
|---|---|
| SecurityException | The user does not have permission to perform this action. |
| IOException | An I/O error occurred. |
The foreground and background colors are restored to the colors that existed when the current process began. For more information, see the ForegroundColor and BackgroundColor properties.
The following example saves the values of the ConsoleColor enumeration to an array and stores the current values of the BackgroundColor and ForegroundColor properties to variables. It then changes the foreground color to each color in the ConsoleColor enumeration except to the color that matches the current background, and it changes the background color to each color in the ConsoleColor enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the ResetColor method to restore the original console colors.
for modifying safe top-level windows and subwindows. Associated enumeration: UIPermissionWindow::SafeTopLevelWindows
Available since 2.0